Last active
December 28, 2015 09:29
-
-
Save itsbalamurali/7479864 to your computer and use it in GitHub Desktop.
Bing Images puller in action http://bingy.herokuapp.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Bing Images puller in action http://bingy.herokuapp.com/ | |
//this snippet will get the bing.com's current image | |
$bingimgxml = file_get_contents('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=en-US'); | |
$bg_img = new SimpleXMLElement($bingimgxml); | |
$image = $bg_img->image->url; | |
$img_url ="http://www.bing.com$image"; | |
header('Content-Type: image/jpeg'); | |
readfile($img_url); | |
//echo $img_url; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment