Listings-Like-This is a very simple demonstration showing how the hListing pattern deployed on Kelkoo can be used in mash ups.
hListing provides a good base for shopping sites, identifying the item for sale, the seller and retail price. All offers on Kelkoo's new pages use hListing; search results, merchant listings, categories and brand pages. Any of those pages can be used as a data source for a product listing mash-up.
Listings-Like-This is a two part hack. The first is a rough-and-ready hListing profile for Drew McLellan's excellent hKit microformat parser, and a quick web service to transform a web page into JSON. That provides the means to consume Kelkoo pages programatically.
You can play with the transformer for hlisting and hcard microformats. The URL is http://hack.ben-ward.co.uk/parse/proxy.php and the following arguments should be somewhat self-explanatory:
profileoutputprint_r object dump of the
parsed structure, or json for use in your mash-up.urlcallbackoutput=JSON only: A callback function to wrap
the JSON array with.So for example, this URL displays the object structure for a Kelkoo search results page: http://hack.ben-ward.co.uk/parse/proxy.php?profile=hlisting&output=text&url=http://shopping.kelkoo.co.uk/ctl/do/search?siteSearchQuery=450D+Canon
Part two of the Listings-Like-This hack is a quick demo of the JSON data being consumed on a blog, in a ‘related products’ widget.
The demo works as follows:
One caveat with Kelkoo is that to prevent click-fraud there are not real URLs for individual offers, so the widget falls back to linking each search result to the search result page itself. If we manage to fix that bug, the widget will automatically start linking directly.