Flickr API を確認中です、認証しないで、画像の検索ができます。
flickr.photos.search
<?php
//url http://www.flickr.com/services/api/explore/flickr.photos.search
//http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg
//or
//http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}_[mstzb].jpg
//or
//http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png)
$test=new flickr('秋葉原');
class flickr{
public function flickr($key){
$url='http://api.flickr.com/services/rest/?';
$imglink='http://farm%s.staticflickr.com/%s/%s_%s_b.jpg';
$imglink='http://farm%s.staticflickr.com/%s/%s_%s.jpg';
$imgshow='<img src="%s" alt="%s" title="%s" />';
$para['method']='flickr.photos.search';
$para['api_key']='********************************';
$para['text']=urldecode($key);
$para['format']='rest';
$para['sort']='date-posted-desc';
ksort($para);
echo $paraurl=$url.http_build_query($para);
$xml=simplexml_load_file($paraurl);
foreach($xml->photos->photo as $key=>$val){
$t_id=$val->attributes()->id;
$t_owner=$val->attributes()->owner;
$t_secret=$val->attributes()->secret;
$t_server=$val->attributes()->server;
$t_farm=$val->attributes()->farm;
$t_title=$val->attributes()->title;
$t_ispublic=$val->attributes()->ispublic;
$t_isfriend=$val->attributes()->isfriend;
$t_isfamily=$val->attributes()->isfamily;
$t_imglink=sprintf($imglink,$t_farm,$t_server,$t_id,$t_secret);
echo sprintf($imgshow,$t_imglink,$t_title,$t_title);
echo '<br>';
echo '<br>';
}
}
public function pinfo($ihoto_id){
}
}
?>
結果(一部)