Not what you're looking for? Visit our Previous Support Site

Item Of Interest

Item Of Interest is a term to represent both a POI and an Event.  As they have a number of common properties and display rules they have one feed.  This allows one feed implementation to display both types.  

The key difference between an Event and POI represented in the Item Of Interest is the nature of its location information.  An Event can occur at multiple locations whereas a POI is a special type of location.  This means that a POI is a location and can only have information about its location parents.
For more information, browse the Item Of Interest API

Basque Coast Music Festival

1
HoursMost concerts daily 9pm
Cost €20-€50

The annual late-summer Basque Coast Music Festival features orchestras, choirs and soloists - all producing classical music of a very high standard. Performances take place in the many glorious churches of Bayonne, Saint-Jean de Luz and Ciboure.

Request:

http://demosite.frommers.biz/frommers/item_of_interest.feed?itemOfInterestId=456700

Response:

<itemOfInterest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="feedschema/base.xsd" id="456700" type="EVENT" typeName="Event" rankId="1" rankName="Recommended" name="Basque Coast Music Festival" cost="€20-€50" openingHours="Most concerts daily 9pm" displayDate="Aug - Sep 2012 (annual)" whatsonwhenId="25632">
  <summary>The annual late-summer Basque Coast Music Festival features orchestras, choirs and soloists - all producing classical music of a very high standard. Performances take place in the many glorious churches of Bayonne, Saint-Jean de Luz and Ciboure.</summary>
  <locationInfos>
    <locationInfo id="145372" locationName="Bayonne" locationType="CITY" locationTypeName="City" latitude="43.4927" longitude="-1.4764">
      <parent id="185138" name="The Basque Country">
        <parent id="143101" name="France">
          <parent id="143019" name="Europe"/>
        </parent>
      </parent>
    </locationInfo>
  </locationInfos>
  <audienceInterests>
    <audienceInterest id="140429" name="Baroque">
      <parent id="140427" name="Classical Music">
        <parent id="141307" name="Classical Music">
          <parent id="530006" name="Events"/>
        </parent>
      </parent>
    </audienceInterest>
    <audienceInterest id="140427" name="Classical Music">
      <parent id="141307" name="Classical Music">
        <parent id="530006" name="Events"/>
      </parent>
    </audienceInterest>
  </audienceInterests>
  <medias>
    <mediaNode id="308185" caption="Viola. Photo by Bree Hogg, © Whatsonwhen" keywords="festival; music; classical; chamber; instrument; harp; flute; arts; architecture; history; heritage">
      <mediaItems>
        <mediaItem type="I-BG" url="/frommers/581/308185-I-BG_classical_generic_viola.jpg" height="150" width="160" mimeType="image/jpeg"/>
        <mediaItem type="I-SM" url="/frommers/581/308185-I-SM_classical_generic_viola.jpg" height="99" width="105" mimeType="image/jpeg"/>
      </mediaItems>
    </mediaNode>
  </medias>
  <links>
    <link url="http://www.musiquecotebasque.fr/" name="Basque Coast Music Festival Website"/>
  </links>
  <dateRanges>
    <dateRange startDate="2012-08-26" endDate="2012-09-09" isTbc="true" isOneOff="false" isOccurMonday="true" isOccurTuesday="true" isOccurWednesday="true" isOccurThursday="true" isOccurFriday="true" isOccurSaturday="true" isOccurSunday="true"/>
    <dateRange startDate="2013-08-25" endDate="2013-09-08" isTbc="true" isOneOff="false" isOccurMonday="true" isOccurTuesday="true" isOccurWednesday="true" isOccurThursday="true" isOccurFriday="true" isOccurSaturday="true" isOccurSunday="true"/>
  </dateRanges>
  <contactInfo name="Festival Box Office and Enquiries" telephone1="+33 (0)5 59 26 03 16" telephone2="+33 (0) 5 59 26 03 16"/>
</itemOfInterest>

Call the feed URL, using curl


$ch = curl_init(); // Set up curl
curl_setopt($ch, CURLOPT_URL, $url); // Add url
curl_setopt($ch, CURLOPT_HEADER, 0); // Remove header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return data
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Set timeout, 10s
$response = curl_exec($ch); // Call feed
curl_close($ch); // Close curl, free resources

Convert response to XML


$itemOfInterest = new SimpleXMLElement($response); // Create xml object

Build output dynamically, displaying decoded HTML content tables of detail groups


<div class="itemOfInterest">
	<h2><span><?php echo htmlspecialchars_decode($itemOfInterest["name"]);?></span></h2>
	<div style="float:right;width:30%">
		<?php if ($itemOfInterest["rankId"]) { ?>
			<div style="float:right" class="rank<?php echo $itemOfInterest["rankId"];?>"><?php echo $itemOfInterest["rankId"];?></div>								
		<?php } ?>
		
		<?php
			$media = null; 
			$media =  $itemOfInterest->xpath("//medias/media[@mediaType='I-BG']");
			if ($media) { ?>
				<div style="float:right;clear:right;"><img src="http://media.wiley.com<?php echo $media[0]["url"]; ?>" alt="<?php echo $media[0]["caption"]; ?>" title="<?php echo $media[0]["caption"]; ?>" /></div>
		<?php } ?>
	</div>
	<?php if ($itemOfInterest->locationInfos->locationInfo ) { 
		$locationInfo = $itemOfInterest->locationInfos->locationInfo;
		if ($locationInfo->address) {
			$address = $locationInfo->address?>
			<div class="address" style="width:65%">
				<?php if ($address["address"]) { ?>
					<?php echo $address["address"]; ?>,
				<?php } ?>
				<?php if ($address["city"]) { ?>
					<?php echo $address["city"]; ?>,
				<?php } ?>
				<?php if ($address["state"]) { ?>
					<?php echo $address["state"]; ?>
				<?php } ?>
				<?php if ($address["postcode"]) { ?>
					<?php echo $address["postcode"]; ?>,
				<?php } ?>
				<?php if ($address["country"]) { ?>
					<?php echo $address["country"]; ?>
				<?php } ?>
			</div>
		<?php } ?>
	<?php } ?>
	
	<div class="detailGroup">
		<table class="infoTable" <?php if ($media) { ?> style="width: 65%" <?php } ?>>
		<?php if ($address["directions"]) { ?>
			<tr><th>Directions</th><td><?php echo $address["directions"]; ?></td></tr>
		<?php } ?>
		<?php if ($address["telephone1"]) { ?>
			<tr><th>Telephone</th><td><?php echo $address["telephone1"]; ?></td></tr>
		<?php } ?>
		<?php if ($address["email"]) { ?>
			<tr><th>Email</th><td><a href="mailto:<?php echo $address["email"]; ?>"><?php echo $address["email"]; ?></a></td></tr>	
		<?php } ?>
		<?php if ($address["fax"]) { ?>
			<tr><th>Fax</th><td><?php echo $address["fax"]; ?></td></tr>
		<?php } ?>
		<?php if ($locationInfo->link) {
			$link = $locationInfo->link ?>
			<tr><th>Website</th><td><a href="<?php if (!strpos($link["url"],"http",0)===0) echo "http://"; echo $link["url"]; ?>"><?php echo $link["name"]; ?></a></td></tr>
		<?php } ?>
		<?php if ($itemOfInterest["openingHours"] && $itemOfInterest["openingHours"] != "") { ?>
			<tr><th>Hours</th><td><?php echo str_replace(';','<br />',$itemOfInterest["openingHours"]); ?></td></tr>
		<?php } ?>
		<?php
			$field = null; 
			$field =  $itemOfInterest->xpath("//fields/field[@key='CUISINE_TYPE1']"); 
			if ($field && $field != "") { ?>
				<tr>
					<th>Cuisine Type</th>
					<td>
						<?php echo $field[0]["value"]; ?><?php
							$field2 = null; 
							$field2 =  $itemOfInterest->xpath("//fields/field[@key='CUISINE_TYPE2']"); 
							if ($field2 && $field2 != "") { ?>,
							<?php echo $field2[0]["value"]; ?><?php } ?>	
					</td>
				</tr>
		<?php } ?>
		<?php if ($itemOfInterest["priceCategoryCode"]) { ?>
			<tr><th>Price Range</th><td>
				<?php if ($itemOfInterest["priceCategoryCode"] == "V") { ?>
					Very Expensive
				<?php } ?>
				<?php if ($itemOfInterest["priceCategoryCode"] == "E") { ?>
					Expensive
				<?php } ?>
				<?php if ($itemOfInterest["priceCategoryCode"] == "M") { ?>
					Moderately Expensive
				<?php } else { ?>
					Well Priced
				<?php } ?>
			</td></tr>
		<?php } ?>
		<?php if ($itemOfInterest["cost"] && $itemOfInterest["cost"] != "") { ?>
			<tr>
				<th>Cost</th>
				<td><?php echo $itemOfInterest["cost"]; ?></td>
			</tr>
		<?php } ?>
		<?php 
			$field = null;
			$field =  $itemOfInterest->xpath("//fields/field[@key='CREDIT_CARDS']"); 
			if ($field && $field != "") { ?>
				<tr>
					<th><?php echo $field[0]["name"];?></th>
					<td><?php echo $field[0]["value"]; ?></td>
				</tr>
			<?php } ?>
		</table>
	</div>
	
	<br />
	
	<?php if ($itemOfInterest->summary && $itemOfInterest->summary != "") { ?>
		<p><?php echo htmlspecialchars_decode($itemOfInterest->summary);?></p>
	<?php } ?>
	<?php if ($itemOfInterest->description && $itemOfInterest->description != "") { ?>
		<p><?php echo htmlspecialchars_decode($itemOfInterest->description);?></p>
	<?php } ?>
	
	
	<?php if ($itemOfInterest->links) { ?>
		<div class="detailGroup">
			<table class="infoTable">
				<tr>
					<th>Additional Links</th>
					<td>
						<?php foreach ($itemOfInterest->links->link as $key=>$link) { ?>
							<a href="<?php if (!strpos($link["url"],"http",0)===0) echo "http://"; echo $link["url"]; ?>"><?php echo $link["name"]; ?></a><br />
						<?php } ?>
					</td>
				</tr>
			</table>
		</div>
	<?php } ?>
</div>

Loading...