|
1 | 1 | # Blog-Pic-go |
2 | 2 |   |
3 | 3 |
|
4 | | -一个潦草的 Bing 每日一图 API 的 Go 语言实现,并提供图片地址持久化存储 |
| 4 | + |
| 5 | + |
| 6 | +~~一个潦草的 Bing 每日一图 API 的 Go 语言实现,并提供图片地址持久化存储~~ |
| 7 | + |
| 8 | +一个潦草的博客壁纸的 Go 语言实现,并提供图片地址持久化存储 |
| 9 | + |
| 10 | +> PS:已经不只是 Bing 每日一图 API 了…… |
| 11 | +
|
5 | 12 |
|
6 | 13 | ## 特点 |
7 | 14 | + 使用 Golang 编写,SQLite3 作为数据库实现,较为轻量化 |
8 | 15 | + 提供自定义设置项,方便个性化 |
| 16 | ++ 提供 Bing 美图以及 NASA 的 APOD |
| 17 | + |
9 | 18 |
|
10 | | -## 部署 |
| 19 | +## 使用 |
11 | 20 |
|
12 | 21 | ### 环境要求 |
13 | 22 | + 任意一台服务器 (required) |
14 | | -+ Go 编译环境 (optional 仅在需要自行编译时需要) |
| 23 | ++ Go 编译环境 (required) |
15 | 24 |
|
16 | | -### 提供二进制文件 |
17 | | -1. 在 [Release](https://github.com/CharlieYu4994/Blog-Pic-go/releases) 页面下载二进制文件 |
18 | | -2. 根据『config.json.template』创建配置文件 |
19 | | -3. 将数据库、配置文件、二进制文件放在同一目录下运行 |
20 | | -4. 访问 `your.domain/bing` 查看效果 |
21 | | - |
22 | | -### 不提供二进制文件 |
| 25 | +### 编译 |
23 | 26 | 1. 在 [Release](https://github.com/CharlieYu4994/Blog-Pic-go/releases) 页面下载源码 |
24 | 27 | 2. 解压并进入文件夹 |
25 | 28 | 3. 在文件夹下运行 `go build ./` |
26 | | -4. 根据『config.json.template』创建配置文件 |
27 | | -5. 将数据库、配置文件、二进制文件放在同一目录下运行 |
28 | | -6. 访问 `your.domain/bing` 查看效果 |
29 | 29 |
|
| 30 | +### 部署 |
| 31 | +1. 根据『config.json.template』创建配置文件 |
| 32 | +2. 将数据库、配置文件、二进制文件放在同一目录下运行 |
| 33 | +3. 访问 `your.domain/bing` 查看效果 |
30 | 34 |
|
31 | | -## 使用 |
32 | | -访问 `your.domain/bing?dat=<date>&res=<resolution>` 然后你会被重定向到图片 |
| 35 | + |
| 36 | +## 访问 |
| 37 | +访问 `your.domain/<type>?dat=<date>&res=<resolution>` 然后你会被重定向到图片 |
33 | 38 |
|
34 | 39 | ### 参数 |
| 40 | +1. type 图片类型 (required) |
| 41 | + + bing:Bing 美图 |
| 42 | + + apod:NASA 的 APOD |
| 43 | + |
35 | 44 | 1. dat 日期偏移 (optional) |
36 | 45 | + 0:当天的,同理 1 为一天前的,最大为你设置的 `picnum`-1 |
37 | 46 | + -1:随机图片 |
|
42 | 51 | + uhdres:当天的最高分辨率,分辨率不定 |
43 | 52 | + `height`x`width`:自定义分辨率(**必须被 Bing 官方支持**) |
44 | 53 | + 可以不提供,不提供默认为 `hdres` |
| 54 | + + NASA 的 APOD 不支持调整分辨率 |
| 55 | + |
45 | 56 |
|
46 | 57 | ## 资源 |
47 | 58 |
|
48 | 59 | ### 官方演示 |
49 | 60 | 大家可以随便使用 |
50 | 61 | ``` |
51 | | -api.lassi-cat.cn:60443/bingapi/bing?dat=<date>&res=<resolution> |
| 62 | +api.lassi-cat.cn:60443/bingapi/<type>?dat=<date>&res=<resolution> |
52 | 63 | ``` |
53 | | - |
54 | 64 | 更多详情请查看 [Demo 主页](https://bing.charlie.moe) |
55 | 65 | > 此 Demo 由 [LassiCat](https://github.com/LassiCat) 的服务器托管运行 ~~(其实就是咱的)~~ |
56 | 66 |
|
57 | 67 | ### 图像数据库 |
58 | 68 | ~~在『main』分支下的『picture.db』为从2021年1月1日开始的图像,不定期更新 (其实不更新)~~ |
59 | 69 |
|
60 | | -请使用 [Bing-API-db](https://github.com/CharlieYu4994/Bing-API-db) 提供的数据 |
| 70 | +请使用 [Blog-Pic-db](https://github.com/CharlieYu4994/Blog-Pic-db) 提供的数据 |
61 | 71 |
|
62 | | -[点击](https://github.com/CharlieYu4994/Bing-API-db/releases/latest/download/picture.db) 下载最新数据库 |
| 72 | +[点击](https://github.com/CharlieYu4994/Blog-Pic-db/releases/latest/download/picture.db) 以下载最新数据库 |
63 | 73 |
|
64 | 74 | ### 对 BingAPI 的研究 |
65 | 75 | [对 BingAPI 的简单研究](https://blog.charlie.moe/post/BingAPI-00/) |
66 | 76 |
|
| 77 | + |
67 | 78 | ## 版权 |
68 | | -Bing 今日美图有微软 Bing 提供,**使用请注意版权,不可用于商业用途** |
| 79 | +Bing 美图由微软 Bing 提供,APOD 由 NASA 提供,**使用请注意版权,不可用于商业用途** |
69 | 80 |
|
70 | 81 | 本程序由 [@CharlieYu4994](https://blog.charlie.moe/) 编写,以 GPLv3 协议发布 |
71 | 82 |
|
|
0 commit comments