A little Flickr hacking (in a good way)
Christian Heilmann is at it again posting an entry about a neat method of grabbing Flickr photos without having to using the Flickr API:
Here you’ll learn how to get Flickr photos into your JavaScript solutions without having to resort to using the full API. As this is a hack you will only get the latest 20 photos, if you need more detailed data like restricted to sets or more at once you’ll need to resort to the flickr API.
I went ahead and used his code to create a small demo and it worked like charm. Obviously, the results are unformatted but with a little help from jQuery, Ext, Prototype or YUI, you can certainly add effects to make the layout much nicer.
Here’s the code. It’s small and concise:
<script>
function jsonFlickrFeed(o){
var i=0;
while(o.items[i]){
document.write('<img src=\"' + o.items[i].media.m + '\" alt=\"' + o.items[i].title +'\">')
i++;
}
}
</script>
<script src=\"http://api.flickr.com/services/feeds/photos_public.gne?tags=hackdayindia&lang=en-us&format=json\"></script>
Based on the pictures, it looks like these Yahoo! guys have entirely too much fun!
Read more on the source site
No comments yet.
feel free to leave a comment
Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs are automatically generated. Off-topic or inappropriate comments will be edited or deleted. Email addresses will never be published. Keep it PG-13 people!
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
All fields marked with " * " are required.

