A while back I wrote my original script to tweet event reminders from Google Calendar and it’s been through a couple of iterations since and been broken for a while. Well finally I got round to update it to use OAuth to connect to twitter using the twitteroauth library and switched to using Postmark Inbound for handling the incoming e-mail.
What you will need
- Web hosting with php
- A Google calendar attached to a Gmail account
- A Postmark account
- A Twitter account
- My script
Getting set up
Register a new twitter app from the Twitter Developer Site (making sure you sign in with the account you want the tweets to come from) – fill out all the necessary fields and click create. On the next page you should get the OAuth details (Consumer key and Consumer secret) and a section to generate your access token and access token secret, these all need putting into the section at the top of the script.
Install the script on your web hosting, along with the twitteroauth directory from twitteroauth at GitHub. If you got to the script URL in a web browser you should see it post a , to your twitter account without any errors. (I need to add some testing code really!)
Set up a server in your Postmark account then go into the Settings page for that server and update the Inbound Hook to point to the full URL of the script on your server to point to your script for inbound emails. Make a note of the inbound e-mail address from the server tab of your settings as you will need this to forward the calendar reminders to.
Add your Inbound Email address as a forwarding address to your Gmail account. It will send a confirmation code to the address, which you can collect from the Inbound section of the Postmark interface
Create a filter in your gmail account to forward your calendar reminders to the Inbound Email address from your postmark account (Mine forwards anything from email@example.com).
Now everything should be in place to start sending reminders. For each event in your calendar set up e-mail reminders for the number of days/hours before you want the reminder tweeted. These should then appear something like this at twitter:
<Description> this afternoon at <time>, <Location>
<Description> next Saturday at <time>, <Location>