PhpFlickr and receiving images from Flickr

I am trying to extract images from Flickr using the phpFlickr library, but the documents look rather vague and the results are not as good as I would like, I wonder if anyone can shed some light on my code (maybe I'm using the wrong syntax?).

It works for some queries mainly on 1 word, i.e. if I send $ tag "inter" it will find some photos on inter, but if I send "Inter Milan FC" it won’t, although the search is flickr http://www.flickr.com/search/?w=all&q= inter + milan + fc & m = text clearly shows a lot of photos of inter milan fc.

Below is my implementation of the phpFlickr function ....

function flickr_feed ( $tag ) {
    $f = new phpFlickr("MY API KEY", "MY API SECRET");
    $tags = $f->photos_search(array("tags"=>$tag, "tag_mode"=>"any","per_page"=>"20"));
    $counter="0";
    foreach ($tags['photo'] as $photo) {
        if($counter =="0" || $counter =="5" || $counter =="10" || $counter =="15") { $first = " first"; } else { $first = ""; }
        echo '<div class="flickr-thumb'.$first.'">
                <a rel="nofollow" target="_blank" href="http://farm'.$photo['farm'].'.static.flickr.com/'.$photo['server'].'/'.$photo['id'].'_'.$photo['secret'].'.jpg" title="'.$photo['title'].'">
                <img src="http://farm'.$photo['farm'].'.static.flickr.com/'.$photo['server'].'/'.$photo['id'].'_'.$photo['secret'].'_s.jpg" alt="'.$photo['title'].'"></a>
            </div>';
        $counter++;     
    }
}

flickr ( phpflickr), flickr , , ! , : (

+3
2

...

$tags = $f->photos_search(array("text"=>$tag, "sort"=>"interestingness-desc","per_page"=>"20"));

"" , !

+1

Flickr API. phpFlickr.php, Flickr.

API- Flickr

+2

Source: https://habr.com/ru/post/1719335/


All Articles