FlickrAPI

I’ve amended the popular WordPress Plugin FlickrRSS to now incorporate the Flickr API facility. I originally did this so I could circumvent the Flickr RSS limit of calling no more than 20 flickr photos at a time.

Some folks had asked for the plugin so it’s currently a Beta Release.  If you have any questions or feedback please get in touch below here or using the new support forum.

Limitations

So far the plugin only works using the API when searching groups and userids, but I plan to extend it to utilise other options.

Support

The plugin has only been in use since Feb 2010 and I’ve had a lot of feedback so for support purposes I’ve setup a forum.  I’ll be monitoring it for any problems and will try to advise.  Visit the forum here.

Kudos

The original authors of FlickRSS are Dave Kellam and Stefano Verna. Many thanks to them.

Plugin Instructions

1. Put the flickrAPI files into your plugins directory
2. If you want to cache images, create a directory and make it writable
3. Activate the plugin
4. Configure your settings via the panel in Options
5. Add `<?php get_flickrAPI(); ?>` somewhere in your templates

Advanced

The plugin also supports a number of parameters, allowing you to have multiple instances across your site.

1. `'type' => 'user'` - The type of Flickr images that you want to show. Possible values: 'user', 'favorite', 'set', 'group', 'public'
2. `'api' => ''` - Optional but the point of the plugin!
3. `'tags' => ''` - Optional: Can be used with type = 'user' or 'public', comma separated
4. `'set' => ''` - Optional: To be used with type = 'set'
5. `'id' => ''` - Optional: Your Group or User ID. To be used with type = 'user' or 'group'
6. `'do_cache' => false` - Enable the image cache
7. `'cache_sizes' => array('square')` - What are the image sizes we want to cache locally? Possible values: 'square', 'thumbnail', 'small', 'medium' or 'large'
8. `'cache_path' => ''` - Where the images are saved (server path)
9. `'cache_uri' => ''` - The URI associated to the cache path (web address)
10. `'num_items' => 4` - The number of images that you want to display
11. `'before_list' => ''` - The HTML to print before the list of images
12. `'html' => '<a href="%flickr_page%" title="%title%"><img src="%image_square%" alt="%title%"></a&>'` - the code to print out for each image. Meta tags available: %flickr_page%, %title%, %image_small%, %image_square%, %image_thumbnail%, %image_medium%
13. `'default_title' => "Untitled Flickr photo"` - the default title
14. `'after_list' => ''` - the HTML to print after the list of images

Example 1

get_flickrAPI(array('num_items' => 36,
'type' => 'group',
'tags' => '',
'id' => '12325216@N00',
'api' => '3370ecbd3e604245581eb4955fd6xxxx')); ?>

This would show the 36 most recent group photos

Example 2

get_flickrAPI(array('num_items' => 30,
'type' => 'user',
'tags' => '',
'id' => '10529805@N00',
'api' => '3370ecbd3e604245581eb4955fd6xxxx')); ?>

This would show the 30 most recent thumbnail sized photos from the specified user’s set.

Example 3

Here is my dashboard page setup which I use to show 24 of my latest photos from my own Flickr page.  I then invoke them via the widgets.  You can see the results in the sidebar.

flickrapi plugin example page 1

flickrapi plugin example page 1

flickrapi plugin example page 2

flickrapi plugin example page 2

47 Comments

  1. Steve Allen added these pithy words on January 29, 2010 | Permalink

    Is it possible to view random pictures?

  2. David added these pithy words on February 2, 2010 | Permalink

    Hi. Nice and simple plugin.

    Is there a way I can get the photos to link to the .jpgs for a lightbox, rather than the flickr page that it's hosted on?

  3. David added these pithy words on February 2, 2010 | Permalink

    durrr. Got it … It was right there in the settings.

    Again, great plugin. This is very light and flexible … good for those who want a bit of control …like including the lightbox of their choosing.

  4. David added these pithy words on February 3, 2010 | Permalink

    Now I can't seem to get the num_items parameter to show more than 19 pictures. If I set it to 1-19 it will show that amount I specify… anything more and it just continues to show 19.

  5. admin added these pithy words on February 3, 2010 | Permalink

    Hi Steve,

    Yes I think it is. I’m looking at this now and will add more examples to this page today.

  6. admin added these pithy words on February 3, 2010 | Permalink

    Hi David,

    Are you using the FlickrAPI settings screen in WordPress or using the direct call in a template page? If it’s a template page can you paste the code you are using (hiding the Flickr API key so no-one else can use it)

    I use both methods on this site. In the Sidebar and on the Photo Diary page and both methods call over 20 photos.

  7. davidw21 added these pithy words on February 3, 2010 | Permalink

    Hi David,

    Are you using the FlickrAPI settings screen in WordPress or using the direct call in a template page? If it's a template page can you paste the code you are using (hiding the Flickr API key so no-one else can use it)

    I use both methods on this site. In the Sidebar and on the Photo Diary page and both methods post over 20 photos.

  8. davidw21 added these pithy words on February 3, 2010 | Permalink

    Hi Steve,

    Yes it is. I'll put up more practical examples above and also include the code that I use which uses “Lightbox Plus”.

    Thanks, Dave

  9. dave added these pithy words on February 5, 2010 | Permalink

    yea, once again, I wasn't looking closely enough at some of the documentation. I was trying to display more than 20 items within a “set”. I realize now that you can only have more than 20 photos pulled (up to 50) when selecting “user” or “group”.

    What I ended up doing was giving (batch) unique tags to my set photos and then using flickr api to pull the 50 pictures by “user” and “tag”.

  10. dizag added these pithy words on February 6, 2010 | Permalink

    no it dosn.t work form me …please help
    in this code fragment something hapens
    // if(!preg_match('<img src=”([^"]*)” [^/]*/>', $item['description'], $imgUrlMatches)) {
    // continue;
    // }
    my ver of wp is 2.9.1 flickr username: dizag and i wont “flicker set” in WP but …!?!?!

  11. dizag added these pithy words on February 6, 2010 | Permalink

    ApiKey is 27b11599bd52d0c9e4d7588c26fa7e39 for example

  12. Mark99 added these pithy words on February 9, 2010 | Permalink

    Is there a way to have this plugin grab more than 50 images?

    Thanks. Plugin works great, I use it with colorbox–a jquery lightbox plugin.

  13. davidw21 added these pithy words on February 9, 2010 | Permalink

    Hi Mark, One of the Flickr API rules is that you don't call more than 30 photos at a time on one page… however if you call more than 30 it does work. I'm a bit wary of changing the plugin to more than 50 at the moment. I'm trying to develop it to include pagination.

    You could however simply edit the plugin… line 10 of flickrapi-settingspage.php … from 50 to whatever number you required. If you abuse it though the good folks at Flickr may disable your API key.

    Hope that helps.

  14. davidw21 added these pithy words on February 9, 2010 | Permalink

    Not sure how you are trying to use the plugin. Can you explain what you've setup and any messages / errors you receive?

  15. dizag added these pithy words on February 9, 2010 | Permalink

    following instructions about installation:
    in directory (/press/wp-content/plugins/flickrapi) have
    flickrapi-settingspage.php
    flickrapi.php
    ——————————-
    flickrAPI Settings:
    Display 6 || set
    api key ***********************7e39
    User ID 44499020@N03
    Set ID 72157622789433256
    Item HTML:
    <img src=”%image_square%” alt=”%title%”/>
    ————————————————-
    in (index.php)

    <?php
    /**
    * @package WordPress
    * @subpackage Default_Theme
    */

    get_header(); ?>

    <?php get_flickrAPI(); ?>
    ….

  16. dizag added these pithy words on February 9, 2010 | Permalink

    there haven't any msg or err!!

  17. davidw21 added these pithy words on February 9, 2010 | Permalink

    Can you try and use the FlickrAPI in a Widget first to ensure that it is working?

    Also, when you call the from a template try and call it with some variables to see if it works.

    i.e.

    get_flickrAPI(array(‘num_items’ => 6,
    ‘type’ => ‘user’,
    ‘tags’ => ”,
    ‘id’ => ‘44499020@N03′,
    ‘api’ => ‘***********************7e39’)); ?>

    Note that when we use a userid and set that the API is not invoked because Flickr doesn't allow those searches yet. It simply will pull back the latest 20 photos. This is something I'm investigating and may have a solution soon, but im the meantime you can always tag your own photos and search them using the tag option.

  18. dizag added these pithy words on February 9, 2010 | Permalink

    tnx for reply …
    but still nothing with err silence
    (i try both of them …)

  19. davidw21 added these pithy words on February 9, 2010 | Permalink

    if you want a help email me :o )

  20. say10 added these pithy words on February 10, 2010 | Permalink

    yeah, displaying group photos doesn't work.

  21. davidw21 added these pithy words on February 12, 2010 | Permalink

    I've got it working in my sidebar. What problems are you having. Version 0.4 will be released today with a debug option so you might wanna hold on for that

  22. say10 added these pithy words on February 12, 2010 | Permalink

    It's almost working! I deactivated it and then reactivated it and now it's displaying 6 photos, but i've set it to display 18. Love the widget though, man…can't wait till it's all dialed in. It's at the bottom: ohhburn.com

  23. say10 added these pithy words on February 12, 2010 | Permalink

    what's happening is that the widget is only showing the photos we uploaded to the group. we want to display all the photos in the group uploaded not only by us but by everyone. is that possible?

  24. davidw21 added these pithy words on February 12, 2010 | Permalink

    I see the group http://www.flickr.com/groups/stuffstonerslike/p... and that has 7 photos in it and that's all I can see. Is there a link where we see all the group?

  25. davidw21 added these pithy words on February 12, 2010 | Permalink

    I see all the group now.. Has this just been setup because it can take Flickr some time to update all the feeds. It's not an instant process. Up to an hour sometimes.

  26. say10 added these pithy words on February 12, 2010 | Permalink

    it's been a few days. hrm. any suggestions?

    once it does start to work, man, it's going to really killer!

  27. davidw21 added these pithy words on February 12, 2010 | Permalink

    I noticed that the main page now has 11 photos but the feed still returned 7. I think patience will sort it out. If there's no improvement by tomorrow I'll investigate further, but I use the Flickr Group “Dundee” in the sidebar and all the pool pictures eventually show.

  28. say10 added these pithy words on February 12, 2010 | Permalink

    thanks for checking it out, man. patience is a tough one…but we'll wait it out. thanks for taking the time to help! we didn't expect it and TOTALLY appreciate it!

  29. davidw21 added these pithy words on February 13, 2010 | Permalink

    Ok .. I investigated a bit. It's a common group problem. Check out Flickr Forum post http://www.flickr.com/help/forum/82334/?search=... and also http://www.flickr.com/help/tags/#2855. Looks like a review and some time will fix it all :o )

  30. James Hambly added these pithy words on February 19, 2010 | Permalink

    Fantastic plugin. I have just one question though:

    When I try to use %image_large% I get a FickR broken link message, whereas %image_medium% works fine.

    Is this to do with a limitation in the account? IE if you have a Pro account you'll be able to access the large images, but otherwise you won't?

    Have people successfully loaded large images from a basic Flickr account?

    Thanks
    James

  31. timatron added these pithy words on February 19, 2010 | Permalink

    i get the same issue on the image_large. any resolution here? i have a pro account and its not working.

    tim

  32. Rodrigo added these pithy words on March 15, 2010 | Permalink

    How to make a little distance between the images? like a 5px border?

  33. admin added these pithy words on March 17, 2010 | Permalink

    You need to use a bit of CSS. I’m going to put an example up today which shows you what I’ve done for my Sidebar.

    Thanks, Dave

  34. Dave Walker added these pithy words on March 17, 2010 | Permalink

    I had a look at the %image_large% problems and it looks like Flickr don’t support this now.

    I’ll be removing it from the next upgrade.

  35. Matt T added these pithy words on March 29, 2010 | Permalink

    Is there a way to set it up so that you can use more than one FlickrAPI widget (say on multiple sidebars)? That is, in the theme I use, Grid Focus, on my blog, there are a few sidebars. A Primary-Main, Primary-Post and Secondary-Shared. I like to have my Flickr photos on the “Primary” or middle sidebar, under my Twitter, brought in by Lifestream.

    Now, Lifestream’s widget has the ability to be placed in multiple sidebars…somehow. Is there a way to do that with FlickrAPI? (I’m currently using two different widgets to do this.)

  36. Dave Walker added these pithy words on April 10, 2010 | Permalink

    Hi Matt,

    Not at the moment. The only thing you could do (and which I do) is hardcode a php call into the theme. So for instance I use the widget in my sidebar, but on the “Karate Ghost” page I use a template which calls the FlickrAPI using the PHP code.

    It’s certainly a good idea that I can try to implement into the next version.

  37. Felipe added these pithy words on April 15, 2010 | Permalink

    The field to input my user id is not shown in my plugin installation. Could you kindly help me?

  38. Dave Walker added these pithy words on April 16, 2010 | Permalink

    Felipe : can you screen grab for me and post it somewhere? ta.

  39. Lori added these pithy words on April 18, 2010 | Permalink

    Any update on posting the CSS example to put some space between the images?

  40. Lori added these pithy words on April 19, 2010 | Permalink

    Nevermind, I figured it out. I took a look at your style sheet, hope that’s OK. Thanks!

  41. Dave Walker added these pithy words on April 21, 2010 | Permalink

    No problem Lori. If you use Firefox as you browser there’s an addon by Chris Pendrick called “Web Developer” which is awesome for seeing and changing CSS. Just Google for it.

  42. Marloes added these pithy words on June 27, 2010 | Permalink

    Very nice plugin!
    I do have one question though: Is it possible to show a random picture from within a set in the sidebar widget? Right now the widget automatically shows the last photo when I set the display to 1. I noticed Steve’s question and your reply on top, just couldn’t find the example.

  43. Dave Walker added these pithy words on July 16, 2010 | Permalink

    I’ve not looked at this for a while Marloes… but am back to looking at it. Will try to update this feature in the latest version.

  44. Steve added these pithy words on August 5, 2010 | Permalink

    Is there an easy way of getting images but not displaying them immediately.

    What I weant to do is

    1) Fetch but not display

    get_flickrAPI(array(‘num_items’ => 20,
    … other params set as required

    2) Then step through the array one at a time outputting them the way I want
    e.g. with a line break after every third (or whatever) item
    Basically I want to be able to do more than appears to be possible with ‘html’ => which acts on very image.

  45. Dave Walker added these pithy words on August 11, 2010 | Permalink

    Hi Steve,

    I’m currently writing something pretty similar to what you’re looking for. It’ll cache an xml file of results and then read through the xml file creating an array to then manipulate.

    If you can wait a week or two I might create a separate plugin.

  46. Carl Martin added these pithy words on August 29, 2010 | Permalink

    This Plugin is not working for me, can you help me out, please? Nothing shows up. When I tell the plugin to show the titles, that works…..but sadly, no images.

  47. Dave Walker added these pithy words on August 31, 2010 | Permalink

    How are you using the plugin Carl? Need some details to check it out… Thanks, Dave

3 Trackbacks

  1. [...] FlickrAPI – Easily display Flickr photos by set, user, favorite, group and public streams. [...]

  2. [...] just below the header. For the integration and presentation I used a slightly modified version of FlickrAPI to fetch my photostream from Flickr and JQuery/Lightbox for the nifty popup. I also got rid of the [...]

  3. [...] Solar Polar » FlickrAPI (tags: flickr plugins wordpress) 0Related PostsWalk on water [...]

POST A COMMENT

Your email is never published nor shared. Required fields are marked *

*
*

Flickr API Plugin

Once we are widgetised we will call the Flickr API Wordpress plugin to show some of my recent pictures.

Widgets

We are going to make these areas Widget-isable. Is that a word? It is now!

Dave Walker

Hello there. I'm Dave Walker and Solar Polar is my wesbite for mucking about. Feel free to get in touch with me. Twitter is you best bet for quick contact.