Created
January 18, 2013 22:53
-
-
Save JeremyMorgan/4569397 to your computer and use it in GitHub Desktop.
Grab public data from Google Calendar
This file contains hidden or 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
<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