Wallpaper

<html>
    <head>
<title>换换壁纸,换换心情</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <!--适配手机显示-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="./index/wallpaper.css" rel="stylesheet" media="screen" type="text/css">
</head>
<body>

<nav>请选择一种类型:</br></nav>
    <choose>
    <a href='/wallpaper.php?p=bing'>            ➥获取微软BING每日壁纸</a></br>
    <a href='/wallpaper.php?p=infintyRandom'>   ➥获取随机的无限壁纸&nbsp;</a></br>
    <a href='/wallpaper.php?p=infintyToday'>    ➥获取今日的无限壁纸&nbsp;</a></br>
    <a href='/wallpaper.php?p=infintyblurRadom'>➥获取模糊随机无限壁纸</a></br>
    <a href='/wallpaper.php?p=infintyblurToday'>➥获取模糊今日无限壁纸</a></br>
    <a href='/wallpaper.php?p=loveWallpaper'>   ➥获取随机的爱壁纸图片</a></br>
    <a href='/wallpaper.php?p=wallhaven'> &ensp;➥获取随机wallhaven壁纸</a></br>
    </choose>
    </body>
</html>
<?php
if (isset($_GET["p"])){
    $p=$_GET["p"];
    if ($p=="bing"){
        $url='http://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1';
        $str=file_get_contents($url);
        preg_match('~"url":"(.*?)","urlbase"~is',$str,$matches);
        $img='http://cn.bing.com'.$matches[1];
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
    elseif ($p=="infintyRandom"){
        $month=rand(1,12);
        $day=rand(1,31);
        $img="http://img.infinitynewtab.com/InfinityWallpaper/$month".'_'."$day.jpg";
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
    elseif ($p=="infintyblurRadom"){
        $month=rand(1,12);
        $day=rand(1,31);
        $img="http://img.infinitynewtab.com/InfinityBlur/$month".'_'."$day.jpg";
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
    elseif ($p=="infintyToday"){
        $month=date("n");
        $day=date("d");
        $img="http://img.infinitynewtab.com/InfinityWallpaper/$month".'_'."$day.jpg";
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
    elseif ($p=="infintyblurToday"){
        $month=date("n");
        $day=date("d");
        $img="http://img.infinitynewtab.com/InfinityBlur/$month".'_'."$day.jpg";
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
    elseif ($p=="loveWallpaper"){
        $url="http://api.lovebizhi.com/macos_v4.php?a=category&spdy=1&tid=3&order=hot&color_id=3&device=105&uuid=436e4ddc389027ba3aef863a27f6e6f9&mode=0&retina=0&client_id=1008&device_id=31547324&model_id=105&size_id=0&channel_id=70001&screen_width=1920&screen_height=1200&bizhi_width=1920&bizhi_height=1200&version_code=19&language=zh-Hans&jailbreak=0&mac=&p={pid}";
        $str=file_get_contents($url);
        preg_match_all('~original":"(.*?)","diy~is',$str,$matches);
        $i=rand(0,59);
        $img=$matches[1][$i];
        $img=str_replace('\\',"",$img);
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
    elseif ($p=="wallhaven"){
        $i=rand(1,480000);
        $img="https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-$i.jpg";
        header('Content-Type: image/JPEG'); @ob_end_clean(); @readfile($img); @flush(); @ob_flush();
    }
}else {
}
?>