My Photos
My Flickr Photos
Register to Vote!
Dirty Greek - Updating Twitter With Google Calendar
| |
Coding : Updating Twitter With Google Calendar
|
|
You are NOT on the DirtyGreek.Org homepage. Please CLICK HERE to go there.
I can't believe I haven't found someone else who has done this, though surely someone has. I don't even really use Twitter except for the programming fun of it, but I figured since it's blowing up right now, I'd try this out.
What this script does is read a Google Calendar feed and check each event's time against the current time. If the event's time falls within a given span around the current time (default is one hour), it will post the event's details to Twitter. In other words, Google Calendar will tell Twitter what you're doing at the current time.
The reason this was a bit of a hack job is that GCal's feed doesn't give you the event's time in the time field, it gives you the time when the event was posted. This is stupid in my opinion, and hampers the ability of others to use the feed realistically. This script takes the event's actual time from the event's description and properly reads it using PHP's strtotime function. It then compares that date against the current time. I plan on using the code I wrote here that makes use of the event's actual date and time to produce a useful RSS feed from a Google Calendar XML feed at some point.
Interfacing your Google Calendar with Twitter in this way is going to take some knowledge of PHP, RSS feeds, and maybe Yahoo Pipes in a pinch, but maybe I or someone else can find a way to make the whole process more simple.
The first thing you need to do is take your Google Calendar XML feed and convert it to true RSS format. Unfortunately, as of now, it's not in the right format. I made a quick Yahoo Pipe to do this. It should be run automatically from the script, so all you need to do is enter your Google login email in the script. It should take care of the rest.
Unfortunately, sometimes Yahoo Pipes hiccups and doesn't return any output. If this happens, just run the script again.
Let me know what you think, feel free to modify the script as long as you give me credit, and tell me if you make any major improvements.
Download Gcal-Twitter
UPDATE: If you downloaded before this update was posted, you may want to re-download.
|
|
|
Posted By George on 03/26/2007 @ 11:04 AM | Link and Discuss (1) | More Coding
Share And Enjoy: 
My Related Posts: Google Maps and Accoutability // Download This American Life Episodes // Ward Churchill Interview With Bill Maher // Web Comics With RSS Feeds // Check with the rapture boys before deciding //
|
|
|
|
No Example? |
| Um, you mind showing an example twitter account with this script updating to it? I saw you through the mailing list and I wanted to see an example, but no such luck here either.
Thanks for posting your script. |
|
Posted by Ryan on 05/11/2007 @ 10:30 PM
|
|
|