Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA249      CA318      CA425      CA651

w2mind.computing.dcu.ie      w2mind.org


Javascript Ajax Flickr application


Embed your own Flickr mini-application in your web pages:
  1. Write a web page with Javascript where you can enter a search term in a box and it will:
  2. Run a program on the server (probably with PHP) to:
  3. Fetch an XML feed from Flickr (*) of images with that tag, and then:
  4. Parse the XML on the client-side with Javascript and show the images in some kind of display (be creative).

  5. Notes:
    1. Running a program on the server: If you do not have CGI, you do have PHP with arguments, and PHP can:
      1. Run server-side commands
      2. Make HTTP requests directly
    2. Instead of the PHP outputting a HTML page in which you include the XML, get the PHP to output XML only (no HTML). See:
      header('Content-type: text/xml');
      
    3. To save load on Flickr's servers, don't actually go to Flickr to get the XML feed while you're debugging. Use a saved XML file for debugging. For the live version you can then test it going to Flickr at run-time.
    4. Flickr API supports JSON format if you want to use that (e.g. in workaround to same-origin policy).

  6. (*) This is a link to a lab where Shell is used to talk to Flickr and parse XML. We will not use Shell here. Here we will instead use PHP to talk to Flickr, and use Javascript to parse the XML.

  7. What to hand up


Feeds      HumphrysFamilyTree.com

Bookmark and Share           On Internet since 1987.