GithubHelp home page GithubHelp logo

agandhi4 / fb2cal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mobeigi/fb2cal

0.0 0.0 0.0 104 KB

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

Home Page: http://bit.ly/fb2cal-blogpost

License: GNU General Public License v3.0

Python 100.00%

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

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

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 repeatedly run the script to periodically generate an updated ics file. See Scheduled Task Frequency section for more info.
  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

fb2cal Setup Guide for Non-Devs [Windows]

fb2cal Setup Guide for Non-Devs [Windows]

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.

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.
  • Some locales are currently not supported (see #13)

Contributions

Contributions are always welcome! Just make a pull request.

Licence

GNU General Public License v3.0

fb2cal's People

Contributors

mobeigi avatar monkler 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.