Syndication flow
Let's use GTrack Syndication !
This page describes how gathering accomodations offers through a CGI (Common Gateway Interface) nammed holigays.php (version 1.00),
and how to integrate search result in your web portail.
1) Calling CGI to request database
2) RSS 1.0 :: XML query result
3) ATOM 2.0 :: XML query result
4) ICAL :: query result
5) Agregation - How to use result
Calling CGI to request database
| holigays.php CGI parameters |
| name |
level |
description |
range |
example |
| model | optional | kind of output format |
rss : result is RSS 1.0
atom : result is ATOM 2.0
ical : result is ICAL
| "model=atom" for XML ATOM output. dafult is rss. |
| lg | optional | Language of output result | fr|en | "lg=en" for US_EN output |
| city | optional | like city | STRING | "city=paris" all offers located in Paris |
| area | mandatory | mandatory ISO Country code and optional region | | "area=FR:06" : offer located in French Riviera "area=US" : offers located in USA |
| smoker | optional | Boolean smoker flag | YES|NO default is all offers | "smoker=NO" for non-smoker people |
| pets | optional | Boolean pets flag | YES|NO default is all offers | "pets=YES" accept pets |
| service | optional | Kind of accomodation | 0:All kind of accomodation1:Home Xchange/Swapping2:Bed & Breakfast3:Vacation let/rental4:Hotel | |
More parameters comming soon next version. For a demonstration, try these exemples :
RSS 1.0 - XML query result
RSS is a Web content syndication format. Its name is an acronym for Really Simple Syndication.
RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website. The XML file just built content result of query according CGI parameters with list of offers (<item> tag) :
<item>
<title>Establishment Name</title>
<link>URL (adress) to load full information of this offer, including offer ID</link>
<description>Offer description</description>
<pubDate>GMT Date/Time offer was posted</pubDate>
<category>Kind of accomodation (Bed and Breakfast, Home eXchange/Swapping or Vacation let/Rental)</category>
</item>
ATOM 2.0 - XML query result
|
Atom is an XML-based file format intended to allow lists of information, known as "feeds", to be synchronised between publishers and consumers. Feeds are composed of a number of items, known as "entries", each with an extensible set of attached metadata. Read this :
atompub.org.
|
|
The XML file just built content result of query according CGI parameters with list of offers (<item> tag) :
<entry>
<title>Establishment Name</title>
<id>URL (adress) to load full information of this offer, including offer ID</id>
<link href="URL (adress) to load full information of this offer, including offer ID">
<content>Offer description</content>
<udpated>GMT Date/Time offer was updated</updated>
<published>GMT Date/Time offer was posted</published>
<category term="Kind of accomodation (Bed and Breakfast, Home eXchange/Swapping or Vacation let/Rental)">
</entry>
ICAL - query result
Coming soon
Agregation - How to use result
When XML file genereted (these samples using RSS output), you can use these PHP functions :
- simplexml_load_file() : Interprets an XML file into an object.
- xml_parse() : Parses XML data while firing events for the specified XML parser.
- xslt_process() for XSL-T mechanisme : Applies a stylesheet contained in one string to XML contained in another, placing the result in a third string.
Otherwhile it's possible to write specific code (a parser) to read/print XML result. Or use direclty CSS technology (Cascading Style Sheet) based on first request (Bed Breakfast in BE):
Build same with ATOM and ICAL outputs.
|