Design a Flickr sidebar that can be used in web pages as follows:
- Flickr sidebar can be used on a website in a right-hand side column.
- In the Flickr sidebar
you can enter a search term in a box, and then on some trigger
(e.g. key press, lose focus, or a button is clicked)
- Fetch an XML or JSON
public feed from Flickr
of recent images with that tag,
- Parse the
XML or JSON
on the client-side and show the images in some kind of display in the sidebar.
The display should highlight the
title and author,
show the image in a small size,
link to the photo page on Flickr.
- In the JSON feed, you can get a nice HTML snippet in:
- In the XML feed, you can get a nice HTML snippet in:
quoted HTML payload
(You have to convert the payload to normal HTML.)
What to hand up
You can use either of these strategies:
- Respect same-origin policy:
Probably use PHP.
This server-side program gets the feed from Flickr.
Get PHP to output just the XML or JSON feed (no HTML) using a HTTP header line:
Content-type: (MIME type for XML)
Content-type: (MIME type for JSON)
- Get around same-origin policy:
to get the feed from Flickr direct.
You can use either of the above strategies.
But you may not use a library like jQuery.
And you may not use sample code
from anyone else.
Also, for clarity,
you may not use anonymous functions.