Code Monkey home page Code Monkey logo

fb2cal's Introduction


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 various async 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 which is then stored on Google Drive as a publically shared file. This ICS file can then be imported into third party tools (such as Google Calendar).
The ICS file can also be stored on the local file system.

This tool does not use the Facebook API.

Requirements

  • python3.6+ (and all required python3 modules)
  • Scheduler tool to automatically run script periodically
  • Google Drive API access

Instructions

  1. Clone repo
    git clone [email protected]:mobeigi/fb2cal.git
  2. Create a Google Drive API credentials
    1. Visit the Google Drive APIs page: https://console.developers.google.com/apis/api/drive.googleapis.com/overview
    2. Create a new project (if you don't already have one)
    3. Enable API (if not already enabled)
    4. Create OAuth consent screen if required
    5. Create Credentials (OAuth client ID)
    6. Download credentials JSON file
  3. Rename credentials JSON file to credentials.json and put it in the src folder
  4. Rename config/config-template.ini to config/config.ini and enter your Facebook email and password as well as a name for your calender to be saved on Google Drive. Initially, the value for the drive_file_id field should be empty.
  5. Install required python modules
    pip install -r requirements.txt
  6. Run script manually once for testing purposes: python ./fb2cal.py
  7. Check Google Drive to ensure your ics file was made.
  8. Setup cron jobs/Task Scheduler/Automator to repeatly run the script to periodically generate an updated ics file. It is recommended to run the script once every 24 hours.
  9. Use the following link to import your ics into Calendar applications (i.e. Google Calendar):
    http://drive.google.com/uc?export=download&id=DRIVE_FILE_ID. Replace DRIVE_FILE_ID with the autopopulated value found in your config/config.ini 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
DRIVEupload_to_driveTrue, FalseIf tool should automatically upload ICS file to Google Drive
drive_file_idThe file id of file to write to on Google Drive. Leave blank to create a new file for the first time.
ics_file_nameThe name of the file to be stored/updated on Google Drive.
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

Contributions

Contributions are always welcome! Just make a pull request.

Licence

GNU General Public License v3.0

fb2cal's People

Contributors

mobeigi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.