开发者

Get Flickr Sets

Usual stuff, Googled forever, looked on here, no help. Yet.

What I want is to list the sets of photos I have on Flickr. Nice & simpl开发者_高级运维e, it would seem. I want the 'title image' (the one used as the thumb for it on Flickr its self), the title and URL. Can't be that hard, can it?

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


Using flickr.photos.search method of the API with your user_id does not work ?

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 minimal implementation you should use stream_context_create() with HTTP headers, use fopen() with this context and build a XMLRPC request by hand as a text variable that you will send. Answer from the socket will be your data

For the 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);


see also http://framework.zend.com/manual/en/zend.service.flickr.html for a nice tidy wrapper

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜