Talking rabbit reminders with Nabaztag and Google Calendar

At ReignDesign we use a shared Google Calendar to help plan our schedules. Todd previously wrote about Reigndesign’s rabbit Nabby. What if there was a way to get Nabby to remind us about our upcoming appointments? Both Nabby and Google Calendar have simple APIs, and other folks have already written client libraries for PHP, so the amount of “glue” required to make it work was surprisingly small!




In Google Calendar, find the calendar you want your Nabaztag to make announcements for. Click the down arrow by the name and choose Calendar settings.


Then right click and copy the link for the iCal private URL.


Create a folder for your PHP project, and create a PHP file as follows:

Nabaztag-Google Calendar mashup!
require("icalparser/SG_iCal.php"); //ical parser
require("Nabaztag.class.php"); //nabaztag class - define your api key and secret in here
$nabby=new Nabaztag;
$parser=new SG_iCal(''); //url of calendar
foreach ($events as $event) {
	if ($ttl>0 && $ttl<15) {
		//it's starting soon!
		if (!file_exists("uids/".$uid)) {
			//we haven't yet announced this event
			$data="Reminder: the event ".$event->getSummary()." is starting in ".round($ttl)." minutes";
			//write to a file to avoid announcing twice
			//call the nabby api

This should be pretty self-explanatory. We loop through the events in the iCal document, looking for any events where the start time is in the next 15 minutes. If we find any, we send some text to the Nabaztag API to speak out loud. Then, we write to a file with the UID of the event to ensure we don’t announce the same event several times.

A few housekeeping bits and pieces:

  • create an empty uids folder
  • on Linux you’ll need to chmod a+w uids to ensure it’s writable
  • set up a cronjob (Linux) or scheduled task (Windows) to run the PHP script as often as you want (say, every 2 or 5 minutes).

Success! A few minutes before your event is due, Nabby will now announce something like Reminder: the event “Lunch 2.0” is starting in 13 minutes.

Listen (mp3 format)

Matt Mayer

Matt Mayer is a founder at ReignDesign. Matt is from the UK and was based in Shanghai for ten years. He is now living in Bangkok, Thailand.

1 comment

  1. Great idea! I was looking for something new to do with my rabbit, and Google calendar has replaced the old calendar on the ‘fridge in our house. I put together an implementation in python using the google calendar python api rather than ical. I set mine up just to read the events for the day once in the morning, but same concept.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this post