Skip to content

Instantly share code, notes, and snippets.

@JeremyMorgan
Created January 18, 2013 22:53
Show Gist options
  • Save JeremyMorgan/4569397 to your computer and use it in GitHub Desktop.
Save JeremyMorgan/4569397 to your computer and use it in GitHub Desktop.
Grab public data from Google Calendar
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
google.load("gdata", "1");
google.setOnLoadCallback(getMyFeed);
var myService;
var feedUrl = "[Feed URL ]";
function handleMyFeed(myResultsFeedRoot) {
$('#content').html('<h3>' + myResultsFeedRoot.feed.getTitle().getText()+ '<h3>');
}
function handleError(e) {
alert("There was an error!");
alert(e.cause ? e.cause.statusText : e.message);
}
function setupMyService() {
myService = new google.gdata.calendar.CalendarService('[ Service name ]');
}
function getMyFeed() {
setupMyService();
myService.getEventsFeed(feedUrl, handleMyFeed, handleError);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment