Initial commit

This commit is contained in:
zhxy-CN 2022-02-27 15:20:48 +08:00
commit f837cd66e5
Signed by: zhxycn
GPG Key ID: 6E4D475F4B47B1FC
2 changed files with 37 additions and 0 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 zhxy-CN
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

16
index.php Normal file
View File

@ -0,0 +1,16 @@
<?php
function a() {
$ago = '0'; // 设定图片的时间(几天前。0为今天1为昨天2为前天-1为明天以此类推由于调用的是必应国内版当日16至次日16时为一张壁纸。)
$data = json_decode(file_get_contents('https://cn.bing.com/HPImageArchive.aspx?format=js&idx='.$ago.'&n=1&mkt=zh-CN'), true);
return "https://cn.bing.com".$data['images'][0]['url'];
};
$url = a();
if ($_GET['encode'] == 'json') {
$echo = array('url' => $url);
echo json_encode($echo);
} else {
header("Location:$url");
}
?>