Quantcast
Channel: e-Doc
Viewing all articles
Browse latest Browse all 10

Using Web Services Tutorial

$
0
0

In this tutorial you will learn how to find Web Service feeds and you will get to transform them into a list of results formatted with the colour and font of your choice. I have prepared a set of PHP files for the Web Service Transformer that will help me demonstrate the power of XML. If you want to continue to work with this I have published them under a creative commons license allowing you to use and make changes to them.


CC-GNU GPL

This software is licensed under the CC-GNU GPL version 2.0 or later.

First let’s have a look at the Web Service Transformation interface. This is a simple form which allows you to submit some parameters that will determine the outcome of the list.

The first parameter is Web Service. For this parameter you need to find a XML feed. Here are some places you can go to find these feeds:

The second parameter is Tag. If we use the example from the Flickr API again we can use the Flickr URL for the method flickr.photosets.getPhotos calling the photoset with the ID = 72157622862470902

The photo-set id can be found in the URL when you look at the photoset on Flickr. The same goes for photos and collections. For group ID and Flickr User ID you can use the idGettr tool where you copy/paste the URL and it gives you the ID.

http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=a8ee0e80254383b35779042d3fadb5d6&photoset_id=72157622862470902&privacy_filter=1&api_sig=4b60ccfb80deb813f72f36c440cb8286

If we input this URL into the interface and check the Print XML only box we will see the XML returned. From this XML we can pick out a tag to use e.g. <photo>

The third parameter is Attribute which allows you to choose an attribute from the tag you chose earlier. In this case I will choose title. Note that this parameter is optional.

The fourth parameter is Colour – have a look at COLOURlover for inspiration.

The fifth parameter is Font – have a look at Larabie‘s fonts for inspiration (you can also see the fonts here)

The parameters input are used to build an XSLT (eXtensible Stylesheet Language Transformation) file which transforms the XML from the Web Service into HTML in the colour and font you chose.

Your turn

  1. Use Flickr Explorer to display a description of a photo from the Vindolanda Fort at Hadrian’s Wall in a red shade and a font beginning with ‘G’
  2. Use Flickr Explorer to display the amount of members in the flickr group ‘Roman Empire’ in a shade of blue and a font beginning with ‘B’
  3. Using APPELLO for the Vindolanda tablets display a list of geographical places with the letter ‘b’ in the name in a green shade and a font of your choosing
  4. Using APPELLO for the Vindolanda tablets display a list of people named ‘flauius’ each with the tablets they occur in listed below the name in a purple shade and a font of your choosing
  5. Using the Baby Name API display your own name in your favorite colour and a font that begins with the same letter as your name

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images