必应每日图片(含接口及源码)

自动更新

Bing首页大图超高清

接口为http://bing.guoch.xyz(或https)

由于该服务器即将终止服务,建议转用备用服务器:https://bing.sh.guoch.xyz

2018-3-10  更新:已经恢复并接入腾讯云CDN

源码如下:

<?php
        $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
        if(preg_match("/<url>(.+?)<\/url>/ies",$str,$matches)){
                $imgurl='http://cn.bing.com'.$matches[1];
        }
        if($imgurl){
                header('Content-Type: image/JPEG');
                @ob_end_clean();
                @readfile($imgurl);
                @flush(); @ob_flush();
                exit();
        }else{
                exit('error');
        }
?>

 

2 条评论

回复 姚冠宇 取消回复

*