Created
May 16, 2012 21:37
-
-
Save murdaugh/2714140 to your computer and use it in GitHub Desktop.
Flickr JSON PHP
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 | |
echo flickr_feed('http://api.flickr.com/services/feeds/photos_public.gne?id=12345678@N06&format=json&nojsoncallback=1'); | |
function flickr_feed($url) { | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$output = curl_exec($ch); | |
curl_close($ch); | |
$details = json_decode($output); | |
$i=0; | |
$htmlString = ''; | |
foreach($details->items as $item) { | |
//DO SOMETHING AWESOME HERE WITH $htmlstring. MAKE IT PRETTY. MAKE IT COUNT. | |
} | |
return $htmlString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment