Tweeting Google Calendar reminders with Postmark
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 calendar.notifier@google.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>
Psalm 119:37
Quote
Turn my eyes from looking at worthless things; and give me life in your ways.
Psalm 119:37
Merry Christmas
Aside
Get your advent calendars here
Yes I know it’s now the 2nd December so this is a day late, but here’s a list of the online advent calendars I’ve seen so far (and I’ll probably keep adding to it!)
24 Ways – Web development tutorial every day till Christmas
DTS Advent Devotionals – A devotional each day on the names of Jesus
Adfont Calendar – A free webfont every day in advent
Prezzo – A competition to win vouchers each day
Inky Advent - An inky picture each day by Johanna Basford
Advent verses – My own one with the advent verses I’ve put in the girls advent calendar
Christmas is Coming – A christmas themed illustration every day
Yo Illo Illustrator’s Advent Calendar – An illustration each day from the group of London Illustrators (found via @VeerUpdate)
11/11/11 11:11
What I was doing…
Fixing a bug in some SQL
But God did not permit Laban harm
You know that I have served your father with all my strength,
yet your father has cheated me and changed my wages ten times. But God did not permit him to harm me.
(Genesis 31:6-7)
In the many years that Jacob had worked for Laban, he had a tough time. First he agreed to work for 7 years so that he could marry Rachel and then Laban swapped his daughters so that he ended up marrying Leah instead, then he had to work a further 7 years to marry Rachel.
Laban consistently deceived Jacob, and attempted to cause him harm by changing his mind and their agreements so many times, but as he did, God protected Jacob from coming to harm. Just before these verses we see God at work in the situation in that which ever marked cattle Laban said Jacob could have, God caused to prosper.