eventList is a super-simple to use jQuery function for displaying a list of forthcoming events on your page.
- Events are marked up as schema.org events, including ISO 8601 timestamps and whatnot
- eventList generates feed links below the events list
- The list is completely unstyled (feature not a bug)
Getting eventList up and running is really really easy.
- Find your calendar ID in the calendar settings page. The calendar must be publicly available.
- Generate a Google Calender API key
- Include the script in your head (you’ll need jQuery and Autolinker.js too)
- Run the plugin on your desired target, passing in the ID for the publicly available Google calendar you would like to display.
<div id="target-div"></div>
<script>
$(document).ready(function(){
args = {
key: 'YOUR_GCAL_API_KEY',
calID: '[email protected]',
maxResults: 12
}
$('#target-div').eventList(args);
});
</script>
The original version of this script was inspired by [this post by Kevin Deldycke] (http://kevin.deldycke.com/2012/07/displaying-upcoming-events-google-calendar-javascript/)
I've included Autolinker.js as a dependency which finds and formats links, Twitter handles and all manner of things in strings. It is very cool.