Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

Facebook to Google Calendar

Add Facebook events to your Google Calendar effortlessly. FIXED(May 2008)

Add to GCal

There's a script that I've been waiting on for a while, but nobody thought to make it. Therefore, I took it into my own hands and created the Facebook to Google Calendar Greasemonkey Script. Yay! Once in google calendar, you can sync it with your cell, have a one click map of the locations, or add it to your RSS reader.

If you have any problems, let me know! Try turning off your other facebook GM scripts and see if anythings conflicting. Also, check the Javascript Error Console in Firefox (Tools->Error Console) to see if it gives you any errors.

What does it do?

Simple: Once installed, just click the "Add to Google Calendar" button in the right hand bar.

Changelog:
May 6th - v1.5: Fixed after Facebook Chat broke it.
May 25th - v1.4: Button move to the right side, under the "Share" and "Export" links. The work for this update was done by Richard Lainchbury (See comments). Thanks Richard!
May 25th - v1.3: Fixed the street names! This is especially useful for mapping the location and also,if you get gcal to text message your events to you, having the full address on hand when you go out to your event. Also, some small syntax changes.
May 14th - v1.2.7: Some tiny changes with the code. If it was acting odd for you before, this may fix it.
May 4th - v1.2.5: Events now open a new window (or, for most of us, tab). Thanks to Zack for the suggestion.
May 1st - v1.2: Changed the way the script handles time. No more timezones!
April 12th - v1.1: Updated to work with new Facebook interface.

Known Issues:

  • Quotation Marks in the title make it go wonky.

Thanks to:
Richard Lainchbury for writing the update in version 1.4
Michael Seiler for his suggestion of button placement and for offering users an alternate version
Zack for the suggestion of opening a new tab




May 7, 2008
someonewhokn... User

I'm sure this is a good script for someone who doesn't want all of their Facebook events in their GCal, but there is a method for getting all of them in automatically:

1. Go to the Events page.
2. Click "Export Events" at the top of the page.
3. A box with a ical link for exporting to GCal, Outlook, iCal, etc. will pop up.
4. Take the link and add it as a calendar in the software of your choice.

The downside is that this gets every event that you have said yes or maybe to, so it can get crowded, but you can always copy the events you always want displayed to your personal calendar and turn off the Facebook calendar from displaying.


 
May 7, 2008
luckydog5656 User

I emailed the author and he fixed it within a few hours. what a great community member. props to the author: P. Organisciak

Works as of this post date


 
Apr 24, 2008
broderboy User

new install, and I don't see it either


 
Apr 20, 2008
Cory Roberts User

Yes, unfortunately, this script doesn't work anymore. If you could fix it that would be fantastic.


 
Apr 18, 2008
LJHarb User

As of today at least, it no longer works... perhaps due to the adding of Facebook Chat.

Please update this!


 
Apr 1, 2008
Cory Roberts User

Thanks, great script, still works as of the date of this comment.


 
Dec 1, 2007
shungkei User

It doesn't work when the name of the event begin with double-quote ".


 
Oct 19, 2007
jonomac User

Quote:Wofl
"is there anyway to do this automatically, so i never have to click anything, just add em all without asking?"

Has anyone managed to have a look at this request at all? Would it not require an automated process from within Facebook and therefore impossible? Even with 30Boxes Facebook app I still have to click "sync profile" to see the results from either in each.


 
Oct 6, 2007
countablyinf... User

I answered my own question! For those curious, it's just down near the bottom of the script. If you search for
http://www.google.com/calendar/event

and replace it with

http://www.google.com/calendar/hosted/yourdomain/event

where yourdomain is the domain for your Google apps, it seems to work!


 
Oct 6, 2007
countablyinf... User

Does anyone have any tips on how to modify this script so that it will be able to add events to Google Calendars that are created under Google Apps for domains?

Currently, when I try to add an event, it wants me to login to google calendar; whereas the calendar that I'm using with Google Apps is at the URL "http://www.google.com/calendar/hosted/<domain>"

Thanks for the script!</domain>


 
Jul 23, 2007
Richard Lain... User

@Wofl

Good idea, I will look at adding a app to do just that. And have your google calendar on your profile or something.


 
Jul 22, 2007
Wofl User

great script

is there anyway to do this automatically, so i never have to click anything, just add em all without asking?


 
Jun 28, 2007
P. Organisciak Script's author

I've fixed the line breaks that Userscripts.org adds. The problem is when you paste the code into the browser, so I'll remember to upload script source from now on.

Wyatt, you shouldn't have to uncomment line 124, though the next line should be commented (i fixed it). I use those for personal testing, so they don't even need to be there.


 
Jun 28, 2007
wyatt User

on firefox 2.0.0.4 for XP, i had to make the following changes to get it to work.

1st, line 124 had to be uncommented

2nd, had to change line 321 to be multiple lines with the quotes and plus signs tricks.

hope that helps someone else out at some point


 
Jun 26, 2007
Richard Lain... User

Ok that should all be fixed up now,
Changelog - version 2.1
Fixed new lines in the description
Fixed long descriptions of URL causing a 400 at google (should be 414, naughty google!)

Known Issues,
substring and replace cause firefox to crash, so I've had to use a few guesses about the content to restrict the lengths.

http://www.freexe.com/files/facebooktogooglecal...


 
Jun 24, 2007
zac echola User

The description was 135 words long.


 
Jun 19, 2007
Richard Lain... User

Does the event have a really long description? I think I might need to trim the length of the description to stop that error


 
Jun 19, 2007
zac echola User

I'm getting a 400 bad request error from google when I use this now.


 
Jun 13, 2007
Richard Lain... User
Ok, I've gone through your messy code and fixed it up. I've put some functions in and taken out the repeated code snippets, and also got rid of the xpath and replace it with a loop through the correct area of the dom. The look up and data collection are now done in one place. And I'm now escaping all the right charactors. I've made it work with Opera so if you don't mind can I send it in to http://userjs.org/? Not sure how the full day event stuff works, so I've left it out. And replacing
with %0A seems to crash firefox so I'm just using textContent instead. Enjoy! facebooktogooglecalendar.user.js
 
May 30, 2007
Tamlyn Rhodes User

I had to fix two erroneous line breaks at line 124 and line 319. After that it works great. Thanks!


 
May 22, 2007
Richard Lain... User

Remove the code at the bottom of the page from:

var sponsorbox;

Upto:
 })();

And put
var addtogcal = document.createElement("div");
var allLists = document.getElementsByTagName('UL');

addtogcal.innerHTML = '';
for(var i = 0; i < allLists.length; i++)
{
	if(allLists[i].className=='actionspro')
	{
		allLists[i].parentNode.insertBefore(addtogcal, allLists[i].nextSibling.nextSibling.nextSibling.nextSibling);
	}
}

In it's place, you can download the code from http://freexe.com/files/facebooktogcal.js until this one gets updated


 
May 11, 2007
Krstoffer User

The timezone works great now. Thanks! =)
Very useful script btw.


 
May 7, 2007
stick_figure User

I'm having trouble making this work. Can someone take another screenshot of where this is supposed to go as of the new redesign? Thanks.


 
May 1, 2007
P. Organisciak Script's author

Okay, I recreated your problem (my test event was wrong!) but the new version should fix it.


 
May 1, 2007
P. Organisciak Script's author

I can't seem to recreate the problem. I get the proper "T100500Z" instead of "T000-19500Z".

What the script essentially does is convert the time to UTC, and then google converts it back again. Kinda pointless, now that I consider it. I'll tweak it to make it simply use the original times.


You could comment on this script if you were logged in.