Get Flickr Pack

Ordinary things, googled forever, looked here, no help. Nonetheless.

I want to list the photos that I have on Flickr. Nice and simple, it would seem. I want an β€œimage title” (the one that is used as the thumb for it on Flickr), title and URL. It can't be that hard, can it?

The language of choice is PHP (5.1.6) or JS (if possible jQuery). Both are good.

+4
source share
2 answers

Using the flickr.photos.search API method with your user_id not working?

For PHP, you have a PEAR-based package here and another library at http://phpflickr.com/ . Should be enough to get through it.

EDIT:

For a minimal implementation, you should use stream_context_create () with HTTP headers, use fopen() with this context, and manually create the XMLRPC request as a text variable that you will send. The response from the socket will be your data.

For API use flickr.photosets.getList

CODE EXAMPLE (you need a valid api key for flickr)

 <?php $apiKey = ''; $userID = ''; $url = 'http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=' .$apiKey.'&user_id='.$userID.'&format=json'; $options = Array('http' => Array('method' => 'GET')); $context = stream_context_create($options); $response = file_get_contents($url, false, $context); $object = json_decode($response); 
+1
source
+1
source

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


All Articles