Adding Technorati to Our Mashup
Technorati is a weblog search engine that tracks posts by tags, as well as other search criteria. Its main site is at http://technorati.com.
As mentioned earlier, a commonly shared functionality in many of today's web services is the support of tags. Flickr has them, and so does Technorati. Technorati provides a mashup of its own, pulling in tag-related photos from Flickr and videos from YouTube to annotate its tag pages.
Technorati's API is a RESTful interface, supports both GET
and POST
requests, and requires a free API key. The API service we're interested in, tag, returns weblog entries that have associated a given tag with its post. The request has the following format, including the two required parameters:
http://api.technorati.com/tag?key=[apikey]&tag=[tag]
Other optional parameters are:
format
XML for XML, RSS for RSS 2.0
Limit
Default of 20, maximum of 100 blog entries to return
start
Used to provide paging, and if set to the limit amount plus one (
limit+1
), returns the next page of resultsexcerptsize
Number of word characters returned, 100 by default
Topexcerptsize
Number of word characters in first post returned, 150 by default
Technorati doesn't provide dynamic scripting and callback function support, which means we have to use a more formalized service request. Since the request is coming from another domain, we're going to have to create a proxy to make the service request on the server and pass the returned data back to the client.
PHP programs making ...
Get Adding Ajax now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.