Get user photos by tag for Openlaszlo’s Flickr Lib

Openlaszlo is really nice to do quick and easy prototypes or applications. It gives you a good structure, and a nice data binding mechanism.
It also has a very small and practical library for Flickr API. It’s called “libflickr” and comes any release for some long now. You can find it in the incubator and there is a simple example to learn how to use it.
Although this Lib has a lot of features, I thought that one was missing: Searching user photos with a particular set of tags.
Yes, I know that the first example is how to search photos with a bunch of tags.. but not for a user only.
These seems to me as a must have feature as normally you may want to restrict your search to a particular user.
Ok, so, what can we do? Well, it’s really very simple.. just add following method to the ‘gFlickr’ Node on ‘libflickr.lzx’ file:
<method name="searchUserWithTags" args="user, tags, apikey">
var argobj = [
{argname:"method",
argvalue:"flickr.photos.search"},
{argname:"user_id",
argvalue:user},
{argname:"tags",
argvalue:tags},
{argname:"extras",
argvalue:"owner_name"}
]
this.doFlickrRequest(photods, argobj, apikey);
</method>
Now you can call this method with your user nsid (how to get it!), your tags and your Flickr API key.
This is just a simple usage/extension of the lib. You can check out Flickr Search API and create your own methods of just generalize this.
About this entry
You’re currently reading “Get user photos by tag for Openlaszlo’s Flickr Lib,” an entry on In an Airplane Under the Sea
- Published:
- 12.18.07 / 12am
- Category:
- RIA
Was it any good?





No comments
Jump to comment form | comments rss [?] | trackback uri [?]