I have recently stopped using Facebook, but I really miss the convenience of the birthday notifications. I tried to find the .ics
which you could export from the Facebook events page to your calendar program but it was nowhere to be found and I thought I would have to script scraping it myself.
A quick search on GitHub later, I found that someone had already beaten me to it.
You can find the repository on github and follow the documentation, but I have documented the steps I followed below:
The first step is to fetch the repository from GitHub and edit the config.
git clone [email protected]:mobeigi/fb2cal.git
cd fb2cal
cp config/config-template.ini config/config.ini
vim config/config.ini
I did not want to upload to google drive which is the default so I edited the default config to save the file locally. In case you face errors, you might need to set logging to DEBUG
to figure out what went wrong.
[AUTH]
fb_email = [email protected]
fb_pass = xxxxxxxxxxx
[DRIVE]
upload_to_drive = False
drive_file_id =
ics_file_name = birthdays.ics
[FILESYSTEM]
save_to_file = True
ics_file_path = ./birthdays.ics
[LOGGING]
level = INFO
Now we need to download the dependencies, I prefer to use pipenv
to automate the virtual environment creation but you can install them using pip
as well.
pipenv shell
pipenv install
Now we need to run the script and wait for it to complete.
cd src
python fb2cal.py
After it is complete you can view the .ics
file and import it into your calendar app.
cat birthdays.ics
Afterwards, don’t forget to delete the config.ini
file containing your facebook password in plaintext.