Skip to main content

Facebook Birthday Events to ICS file converter

Project description


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.9+
  • pipenv
  • Scheduler tool to automatically run script periodically (optional)

PyPi Project

https://pypi.org/project/fb2cal/

Instructions

PyPi (Recommended)

  1. In an empty folder of your choice, set up pipenv environment
    pipenv install
  2. Install fb2cal module:
    pipenv run pip install fb2cal
  3. Download config/config-template.ini file and store it in config/config.ini.
  4. Update the config/config.ini file and enter your Facebook email and password (no quotes).
  5. Run the fb2cal module
    pipenv run python -m fb2cal
  6. Check the output folder (out by default) for the created birthdays.ics file

Local

  1. Clone repo
    git clone git@github.com:mobeigi/fb2cal.git
  2. Copy config/config-template.ini to config/config.ini.
  3. Update the config/config.ini file and enter your Facebook email and password (no quotes).
  4. Set up pipenv environment
    pipenv install
  5. Run the fb2cal module
    pipenv run python -m fb2cal
  6. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fb2cal-1.3.2.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fb2cal-1.3.2-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file fb2cal-1.3.2.tar.gz.

File metadata

  • Download URL: fb2cal-1.3.2.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for fb2cal-1.3.2.tar.gz
Algorithm Hash digest
SHA256 16a20932ff4b0d0736ba73181412b638eb6c36f7a461f9452c3b260ed835bb9c
MD5 273fae7e809d58b1a1c38c6dc0c62a1e
BLAKE2b-256 e1ade52f5590a98068f709fb7d5376644b9817b2c898bde383909dadb645a9b3

See more details on using hashes here.

File details

Details for the file fb2cal-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: fb2cal-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for fb2cal-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3738a77b051526953a83113d550a781d3b9cac980cc69a541811ef207cedd706
MD5 78b19526c7242675ec2f29a023c21b02
BLAKE2b-256 4a5b568fb9de51366a175b9072a95b7ed12136a71a4bf27ebb9ca43d1fe4bd7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page