Skip to content
forked from mobeigi/fb2cal

Fetch Facebook Birthdays events and create an ICS file for use with calendar apps

License

Notifications You must be signed in to change notification settings

calindsay/fb2cal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


fb2cal

Facebook Birthday Events to ICS file converter


Description

Around 20 June 2019, Facebook removed their Facebook Birthday ICS export option.
This change was unannounced and no reason was ever released.

fb2cal is a tool which restores this functionality.
It works by calling endpoints that power the https://www.facebook.com/events/birthdays/ page.
After gathering a list of birthdays for all the users friends for a full year, it creates a ICS calendar file. This ICS file can then be imported into third party tools (such as Google Calendar or Apple Calendar).

Caveats

  • Facebook accounts secured with 2FA are currently not supported (see #9)
  • During Facebook authentication, a security checkpoint may trigger that will force you to change your Facebook password.

Requirements

  • Facebook account
  • Python 3.6+
  • pipenv
  • Scheduler tool to automatically run script periodically (optional)

Instructions

  1. Clone repo
    git clone [email protected]:mobeigi/fb2cal.git
  2. Rename config/config-template.ini to config/config.ini and enter your Facebook email and password (no quotes).
  3. Set up pipenv environment
    pipenv install
  4. Run the fb2cal module
    pipenv run python -m fb2cal
  5. Check the output folder (out by default) for the created birthdays.ics file

Configuration

This tool can be configured by editing the config/config.ini configuration file.

Section Key Valid Values Description
AUTHfb_emailYour Facebook login email
fb_passwordYour Facebook login password
FILESYSTEMsave_to_fileTrue, FalseIf tool should save ICS file to the local file system
ics_file_pathPath to save ICS file to (including file name)
LOGGINGlevelDEBUG, INFO, WARNING, ERROR, CRITICALLogging level to use. Default: INFO

Scheduled Task Frequency

It is recommended to run the script once every 24 hours to update the ICS file to ensure it is synchronized with the latest Facebook changes (due to friend addition/removal) and to respect the privacy of users who decide to hide their birthday later on. Facebook originally recommended polling for birthday updates once every 12 hours based on the X-PUBLISHED-TTL:PT12H header included in their ICS files.

Testing

  1. Set up pipenv environment
    pipenv install
  2. Install the fb2cal module
    pipenv run python -m pip install .
  3. Run the unittests module on the tests folder
    pipenv run python -m unittest discover tests

Troubleshooting

If you encounter any issues, please open the config/config.ini configuration file and set the LOGGING level to DEBUG (it is INFO by default). Include these logs when asking for help.

Contributions

Contributions are always welcome! Just make a pull request.

Licence

GNU General Public License v3.0

About

Fetch Facebook Birthdays events and create an ICS file for use with calendar apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%