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)
- In an empty folder of your choice, set up pipenv environment
pipenv install
- Install
fb2cal
module:
pipenv run pip install fb2cal
- Download config/config-template.ini file and store it in
config/config.ini
. - Update the
config/config.ini
file and enter your Facebook email and password (no quotes). - Run the
fb2cal
module
pipenv run python -m fb2cal
- Check the output folder (
out
by default) for the createdbirthdays.ics
file
Local
- Clone repo
git clone git@github.com:mobeigi/fb2cal.git
- Copy
config/config-template.ini
toconfig/config.ini
. - Update the
config/config.ini
file and enter your Facebook email and password (no quotes). - Set up pipenv environment
pipenv install
- Run the
fb2cal
module
pipenv run python -m fb2cal
- Check the output folder (
out
by default) for the createdbirthdays.ics
file
Configuration
This tool can be configured by editing the config/config.ini
configuration file.
Section | Key | Valid Values | Description |
---|---|---|---|
AUTH | fb_email | Your Facebook login email | |
fb_password | Your Facebook login password | ||
FILESYSTEM | save_to_file | True, False | If tool should save ICS file to the local file system |
ics_file_path | Path to save ICS file to (including file name) | ||
LOGGING | level | DEBUG, INFO, WARNING, ERROR, CRITICAL | Logging 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
- Set up pipenv environment
pipenv install
- Install the
fb2cal
module
pipenv run python -m pip install .
- Run the
unittests
module on thetests
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fb2cal-1.3.1.tar.gz
.
File metadata
- Download URL: fb2cal-1.3.1.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c0a27fff47361120ea02834af693e76a9641c04b94fb5714ebac249039df2b8 |
|
MD5 | 87f1413b4d5fd92ca204631403226c39 |
|
BLAKE2b-256 | 9161e3245f801d9f6f3cfba3f36b697a561f46bb597890fb0c74ea838da4df31 |
File details
Details for the file fb2cal-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: fb2cal-1.3.1-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7508bc19388135215953eb7f43689a8c6c573f02e75b7816661dcdf257a95bd |
|
MD5 | 334ee25d618b70ae460f087f699ad767 |
|
BLAKE2b-256 | c7a1467260554d6cd3c7ff8ad790ae1f326ce56d7ca17ec104e8904bbce0b48a |