views:

998

answers:

2

Hi,

I am using a bespoke JQuery/PHP script which parses a Flickr feed using SimpliePie and outputs an image gallery.

I have instructed my client to upload there images into their flickr account.

The images are showing but the feed seems to be limiting to 20 images, however, there are 40 images in the stream.

I have checked the API and there doesn't seem to be any paramaters to change this.

Has anyone come across this before, can anyone help me tweak the feed so that it pulls all the images in the photostream?

Here is the Flickr Stream and feed...

http://www.flickr.com/photos/44280289@N04/

http://api.flickr.com/services/feeds/photos%5Fpublic.gne?id=44280289@N04&lang=en-us&format=rss%5F200

+1  A: 

It seems like you want to use the photosets.getPhotos api call. It will give you a maximum of 500 photos.

Here is an example which gives you the url of the photo in url_o

http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&extras=url_o&photoset_id=72157622766901612&api_key=[YOUR APIKEY HERE]

You need an api key to make it work.

You can also get the output as JSON directly by adding &format=json to the url.

adamse
thankyou for your prompt reply adamse i'll give it a whirl now!
Dan C
Dan C
Why don't you make it easy on yourself and use JSON (or something else) instead. PHP has a built in JSON parser (http://php.net/manual/en/function.json-decode.php)
adamse
+1  A: 

It appears that they do limit it to the initial 20 photos on flickr

http://www.flickr.com/help/website/

Why do I only see 20 items in RSS feeds?

Flickr only shows the latest 20 items in a feed. Because of this, the first time you connect to a feed you will only see the most recent items. But if your RSS reader saves items (as most do) you will see more than 20 as the items build up over time.

But you could potentially use the flickr api, particularly http://www.flickr.com/services/api/flickr.photosets.getPhotos.html

Which allows you to get more (You will need to get an API key however)


Edit:

Though I have not personally used it I have read/heard good things about http://phpflickr.com/ which is a flickr api wrapper for php 4 and 5


Edit 2: Unfortunately I can not comment on your comment but if you take a look at this link from the flickr code blog

http://code.flickr.com/blog/2008/08/25/api-responses-as-feeds/

Some API responses can been provided as feeds so you could try using "&format=feed-rss_200" not sure if it includes getPhotos yet though.

houmam
nope that didnt work :( How else could I approach this?.What gallery do you use which is easy to implement on a Static webpage which the user can update themselves?
Dan C
I personally have only used "Gallery" at http://gallery.menalto.com/ but that might be way too much for your needs.If you are comfortable tinkering with the flickr API you could potentially try and build an rss feed from the JSON results provided and feed that into SimplePie? Or skip SimplePie all together and work with the JSON result instead.
houmam