Last Wednesday, approximately 50% of us attended the Yahoo! Developer Network evening in Barcelona, where Chris Heilmann presented some interesting stuff about what YDN is able to offer. What he talked about is quite well explained in his blog, so we’re just pointing at it from here.
We’re also taking this opportunity to show some lamb pictures (or rather, lamb-tagged photos from flickr
right here, using some minor modifications from his Barcelona YQL example.
$root = 'http://query.yahooapis.com/v1/public/yql?q=';
$yql = 'select * from flickr.photos.info where photo_id in '.
'(select id from flickr.photos.search where tags = "lamb") limit 8';
$url = $root . urlencode($yql) . '&format=json';
$photos = getstuff($url);
$photos = json_decode($photos);
foreach($photos->query->results->photo as $s){
$src = “http://farm{$s->farm}.static.flickr.com/{$s->server}/”.
“{$s->id}_{$s->secret}_s.jpg”;
$phHTML.=’
$s->title.’” src=”‘.$src.’”>‘;
}
echo “
“;
echo $phHTML;
echo “
“;
function getstuff($url){
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
if (empty($buffer)){
return ‘Error retrieving data, please try later.’;
} else {
return $buffer;
}
}
?>
Looking forward to use this in (even more!;-) useful scenarios…
Trackbacks & Pingbacks 1
[...] have not forgotten other code events; for example we were able to attend a Yahoo! Developer Network evening in Barcelona and then another one in Madrid. Regarding older projects, with so many things [...]
Post a Comment