整理了一些api,想要的可以进来看看
#声明:
每日一图来自Bing.com
#每日一图
这个有人做了现成的233,我试过抓bing的包,api是抓到了,可是bing禁止我跨域访问…()挠头…
既然有人做了现成的,那就用呗
图片地址改成如下即可
https://api.dujin.org/bing/1920.php
例如:
<img src="https://api.dujin.org/bing/1920.php"/>
#安卓壁纸
#不分类别获取壁纸接口
url:http://service.picasso.adesk.com/v1/vertical/vertical
拼接参数:
-
limit
:返回数量 -
adult
:布尔值,暂时未知 -
first
:数字,如1 -
skip
:略过数量 -
order
:值hot
为favs,new
json 示例:
{
"msg": "success",
"res": {
"vertical": [
{
"preview": "http://img5.adesk.com/595de628e7bce77b95a5968f",
"thumb": "http://img5.adesk.com/595de628e7bce77b95a5968f?imageMogr2/thumbnail/!350x540r/gravity/Center/crop/350x540",
"img": "http://img5.adesk.com/595de628e7bce77b95a5968f?imageMogr2/thumbnail/!720x1280r/gravity/Center/crop/720x1280",
"views": 0,
"cid": [
"4e4d610cdf714d2966000002"
],
"ncos": 10,
"rank": 221797,
"url": [
],
"tag": [
"海",
"海浪",
"蓝色",
"风景",
"沙滩"
],
"rule": "?imageMogr2/thumbnail/!$<Width>x$<Height>r/gravity/Center/crop/$<Width>x$<Height>",
"wp": "http://img5.adesk.com/595de628e7bce77b95a5968f",
"xr": false,
"cr": false,
"favs": 1725,
"atime": 1500618604,
"id": "595de628e7bce77b95a5968f",
"store": "qiniu",
"desc": ""
}
]
},
"code": 0 }
解析:
-
msg
:响应信息 -
res
:返回的数据-
vertical
:返回的壁纸数据-
preview
:壁纸地址 -
thumb
:小缩略图地址 -
img
:大缩略图地址 -
views
:查看数 -
cid
:所属的类别ID
-
-
rank
:点赞数 -
tag
:壁纸标签 -
rule
:返回不同大小壁纸规则 -
wp
:手机版下载地址 -
favs
:收藏数 -
atime
:创建时间(单位:秒) -
id
:ID -
store
:云服务器地址 -
desc
:描述
-
-
code
:返回码
给懒人吃瓜群众的实例代码:
var imghot = new XMLHttpRequest();
imghot.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
m = JSON.parse(this.responseText);
document.getElementById("img1").src = m.res.vertical[0].preview;
}
};
imghot.open("GET", "http://service.picasso.adesk.com/v1/vertical/vertical?limit=30&skip=180&adult=false&first=0&order=hot", true);
imghot.send();
var imgnew = new XMLHttpRequest();
imgnew.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
m2 = JSON.parse(this.responseText);
document.getElementById("img2").src = m2.res.vertical[0].wp;
}
};
imgnew.open("GET", "http://service.picasso.adesk.com/v1/vertical/vertical?limit=30&skip=180&adult=false&first=0&order=new", true);
imgnew.send();
API源丢给你们了,怎么用就是你们的事了,仅供学习,请勿用于商业用途!!