Sample Using JSON Output to Populate a Simile Timeline Widget
This sample shows how to use Google Calendar as an event source for a Simile Timeline widget. Now you can display your calendar data on a snazzy AJAX timeline!
Here we display the
Google Doodle calendar with web content events along the
Timeline. You can click an event to see the Doodle that was displayed on
the Google home page on that day.
Show me the JavaScript that loads the JSON
// Atom feed for the Google Doodle calendar
var feedUrl = "http://www.google.com/calendar/feeds/c4o4i7m2lbamc4k26sc2vokh5g%40group.calendar.google.com/public/full";
// Google is a little fuzzy about its birthday:
// http://www.google.com/support/bin/answer.py?answer=4866
var startDate = new Date(1998, 9, 1);
var endDate = new Date();
var getParams = '?start-min=' + convertToGDataDate(startDate) +
'&start-max=' + convertToGDataDate(endDate) +
'&alt=json-in-script' +
'&callback=loadGDataCallback' +
'&max-results=5000'; // choose 5000 as an arbitrarily large number
feedUrl += getParams;
var scriptTag = document.createElement('script');
scriptTag.src = feedUrl;
document.body.appendChild(scriptTag);
Subscribe to the Google Doodle calendar: