Created
May 1, 2009 08:25
-
-
Save deplorableword/104934 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> | |
<a class='map' href='".'http://upcoming.yahoo.com/maps/'.$eventID[4]."'>Map & Diretions</a>"; | |
echo "</div></div>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment