在微软必应网站上获取高清网页背景图

摘要: 做网页,有一张漂亮的高清背景图是一件赏心悦目的事。微软必应就有这样的服务,隔一段时间变化一个背景图,看起来很不错

做网页,有一张漂亮的高清背景图是一件赏心悦目的事。微软必应就有这样的服务,隔一段时间变化一个背景图,看起来很不错。可以通过如下地址请求拿到背景图片地址:

https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US

请求的结果如下:

{images: [
],
startdate: "20210311",
fullstartdate: "202103110800",
enddate: "20210312",
url: "/th?id=OHR.CapePerpetua_EN-CN1657098545_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
urlbase: "/th?id=OHR.CapePerpetua_EN-CN1657098545",
copyright: "Thor's Well at Cape Perpetua on the Oregon coast (© Cavan Images/Offset by Shutterstock)",
copyrightlink: "https://www.bing.com/search?q=thor%27s+well+oregon&form=hpcapt&filters=HpDate%3a%2220210311_0800%22",
title: "Welcome to the 'drainpipe of the Pacific'",
quiz: "/search?q=Bing+homepage+quiz&filters=WQOskey:%22HPQuiz_20210311_CapePerpetua%22&FORM=HPQUIZ",
wp: true,
hsh: "3bc4d4f0735db9ba4f39c4b7f377b3a8",
drk: 1,
top: 1,
bot: 1,
hs: [ ]
{
}
tooltips: {
}
loading: "Loading...",
previous: "Previous image",
next: "Next image",
walle: "This image is not available to download as wallpaper.",
walls: "Download this image. Use of this image is restricted to wallpaper only."
}

然后只要取到images[0].url 就得到图片地址了,请求这个地址,每隔一段时间图片会变化. 然后用javascript或者其他方式,就可以直接在页面设置背景图了。背景图的地址就是:

 https://www.bing.com/ + images[0].url

上一篇: Openwrt luci 用模板做页面报错: unfinished string near '"'
下一篇: MQTT Mosquitto 2.0.x版本使用需要注意的事项
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号