bing 每日一图
项目地址:
https://github.com/mo7ccWebsite/bz.mo7.cc
golang gin 框架练手项目
https://bz.mo7.cc/api/public/url
使用方法:
get 请求,http 与 https 均兼容,允许跨域
返回的数据格式 json
,是图片的 url 数组,可直接取用.
第一张为当天 cn.bing.com 背景
1 2 3 4 5 6 7 8 9 10
| [ "https://cn.bing.com/th?id=OHR.QuoichBowl_ZH-CN5583756085_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.AtigunPassAurora_ZH-CN5486073819_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.WinterRoofs_ZH-CN5091303265_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.XmasBeachHuts_ZH-CN6195800613_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.WernigerodeWeihnachtsmarkt_ZH-CN1081480865_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.SantaJusta_ZH-CN0849826455_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.AmericanRobin_ZH-CN0667508209_1920x1080.jpg", "https://cn.bing.com/th?id=OHR.ElPanecilloHill_ZH-CN0527709139_1920x1080.jpg" ]
|
直接返回图片
请求地址
1 2 3
| https://bz.mo7.cc/api/public/bz
|
使用方法
1
| <img src="http//bz.mo7.cc/api/public/bz" alt="" />
|
兼容 http 与 https
效果如下图

请求参数
属性 |
类型 |
必填 |
默认 |
idx |
int |
否 |
null |
0 则为随机返回某一张图片,1-8 则返回对应的壁纸, 例如 1 返回当前 cn.bing.com 的壁纸
使用方法
1 2 3
| <img src="http://bz.mo7.cc/api/public/bz" alt="" /> <img src="http://bz.mo7.cc/api/public/bz?idx=1" alt="" /> <img src="http://bz.mo7.cc/api/public/bz?idx=1" alt="" />
|
效果如下图

博客地址:http://mo7.cc