This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
/
index.php
154 lines (130 loc) · 6.75 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
/**
* CopyRight Bitmoe · eary
* Link https://api.ioliu.cn
* Follow https://github.com/eary/bing
*/
require('./lib/base.php');
$p = $_REQUEST['p'];
$api = new Base();
$pics = $api -> getPicsByPagin($p);
?>
<!DOCTYPE HTML>
<html>
<head>
<title>
<?php
if($p>1){
echo '第'.$pics['page']['pageNo'].'页 - 必应壁纸 ';
}else {
echo '首页 - 必应壁纸 ';
}
?>
</title>
<meta charset="utf-8" />
<meta property="wb:webmaster" content="4513019856d2091e" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<meta name="keywords" content="Bing,必应壁纸,bing壁纸api,Bing每日壁纸,壁纸分享,高清壁纸下载,必应壁纸">
<meta name="description" content="风景, 这边独好。">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,minimum-scale=1,maximum-scale=1">
<meta name="author" content="Bitmoe · eary">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<meta name="theme-color" content="#4F4F4F"/><link href="/assets/css/images/bing.ico" rel="shortcut icon"/>
</head>
<body>
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<h1><a href="/"><strong>© ioliu.cn</strong></a></h1>
<nav>
<ul>
<li><a href="#footer" class="icon fa-info-circle">About</a></li>
<li><a href="/<?php echo $pics['page']['prevNo'] ?>" class=""><i class="icon fa-chevron-circle-left"></i> PREV</a></li>
<li><a href="/<?php echo $pics['page']['nextNo'] ?>" class="">NEXT <i class="icon fa-chevron-circle-right"></i></a></li>
</ul>
</nav>
</header>
<!-- Main -->
<div id="main">
<?php
foreach($pics['images'] as $key=>$value){
echo '<article class="thumb">
<a href="'.$value['img_url'].'" class="image"><img src="'.$value['img_url'].'" alt="" /></a>
<h2>#'.$value['date'].'# '.$value['copyright'].'</h2>
<p>
<a target="_blank" href="'.'http://'.$_SERVER['HTTP_HOST'].'/detail/'.$value['id'].'" class="button">详情</a>
<a target="_blank" rel="nofollow" href="'.$value['url'].'" class="button">下载</a>
<a target="_blank" rel="nofollow" href="http://service.weibo.com/share/share.php?url='.urlencode('http://'.$_SERVER['HTTP_HOST'].'/detail/'.$value['id']).'&title='.urlencode('#必应壁纸# '.$value['date'].' / #'.$value['title'].'# '.$value['description']).'&appkey=1833831541&pic='.urlencode($value['url']).'" class="button">分享</a>
</p>
</article>';
}
?>
</div>
<!-- Footer -->
<footer id="footer" class="panel">
<div class="inner ">
<div>
<section>
<h2>Bing 壁纸 api 用法</h2>
<p>1. 访问 <a href="/bing" target="_blank" >https://api.ioliu.cn/bing</a>, 返回bing每日最新背景图. 可选参数[w,h] </p>
<p>2. 访问 <a href="/bing?d=0" target="_blank" >https://api.ioliu.cn/bing?d=n</a> (n>=0, max=<span class="max">00</span>), 返回以当日为起点n天前的壁纸. 可选参数[w,h] </p>
<p>3. 访问 <a href="/bing/json" target="_blank" >https://api.ioliu.cn/bing/json</a> , 返回bing每日最新壁纸的相关(介绍、图片地址等)信息(json格式).</p>
<p>4. 访问 <a href="/bing/rand" target="_blank" >https://api.ioliu.cn/bing/rand</a> , 返回随机图片. 可选参数[w,h]</p>
<p>目前已知分辨率[w,h]请点击 → <a rel='nofollow' href="https://github.com/Eary/bing#目前已知分辨率">https://github.com/Eary/bing</a> </p>
</section>
<section>
<h2>Follow me on ...</h2>
<ul class="icons">
<!--<li><a target="_blank" href="#" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
<li><a target="_blank" href="#" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
<li><a target="_blank" href="#" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
<li><a target="_blank" href="#" class="icon fa-dribbble"><span class="label">Dribbble</span></a></li>-->
<li><a target="_blank" rel='nofollow' href="http://github.com/eary/bing" class="icon fa-github"><span class="label">GitHub</span></a></li>
<li><a target="_blank" rel='nofollow' href="http://weibo.com/1842336184" class="icon fa-weibo"><span class="label">Weibo</span></a></li>
<li><a target="_blank" rel='nofollow' href="mailto:yy.liu@foxmail.com" class="icon fa-envelope"><span class="label">Mail</span></a></li>
</ul>
</section>
<p class="copyright">
<a rel='nofollow' href="http://www.miitbeian.gov.cn/">粤ICP备15050037号</a>
© 2016. <a href="/">ioliu.cn</a>. POWERED BY Bing.
</p>
</div>
</div>
</footer>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.poptrox.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>
<script>
$(function(){
var start = "2016-03-04";
var startDate = (new Date(start)).getTime();
var now = new Date();
var today = now.getFullYear() + '-' + (now.getMonth()+1) + '-' + now.getDate();
now = (new Date(today)).getTime();
var calc = Math.floor((new Date(now - startDate)) / 1000 / 60 / 60 / 24);
$('.max').html(calc);
console.time('loadJson');
$.get('./bing/json/index.php',function(data){
console.log(data);
console.timeEnd('loadJson');
},'json');
//百度统计
var _hmt = _hmt || [];
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?99d1e1ee6b085485bc6ec3e23b821b49";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
});
</script>
</body>
</html>