Skip to content

Instantly share code, notes, and snippets.

@deplorableword
Created May 1, 2009 08:25
Show Gist options
  • Save deplorableword/104934 to your computer and use it in GitHub Desktop.
Save deplorableword/104934 to your computer and use it in GitHub Desktop.
<?php
// grab everything tagged bsmc and show it nicely
include_once(ABSPATH . WPINC . '/rss.php');
$rss = fetch_rss('http://upcoming.yahoo.com/syndicate/v2/tag/bsmc');
// set the timezone to GMT
date_default_timezone_set('Europe/London');
foreach ($rss->items as $item) {
// nuke -1 hour, cos daylight saving isn't right
$time = strtotime("-1 hours", strtotime($item['xcal']['dtstart']));
$eventID = explode('/', $item['link']);
echo "<div class='vevent' id='hcalendar-Birmingham-Social-Media-Cafe'>";
echo "<span class='summary'>".$item['title']."</span>";
echo "When: <abbr class='dtstart' title='".date('Y-m-d', $time)."'>".date('l dS g:iA' ,$time) ."</abbr><br />";
echo "Where: <span class='location'>" . $item['xcal']['x-calconnect-venue_adr_x-calconnect-venue-name'] . ', ' .
$item['xcal']['x-calconnect-venue_adr_x-calconnect-street'] . ', ' .
$item['xcal']['x-calconnect-venue_adr_x-calconnect-city'] . ', ' .
$item['xcal']['x-calconnect-venue_adr_x-calconnect-postalcode'] . '</span>';
echo "<div class='info'>
<a class='url' href='".$item['link']."' title='hurray!'>I'm going!</a> &nbsp;
<a class='map' href='".'http://upcoming.yahoo.com/maps/'.$eventID[4]."'>Map &amp; Diretions</a>";
echo "</div></div>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment