This script will take the emails sent by codeforces on contests and aim to add events on your calender according to the contest dates and durations.
-
Go to Google Cloud Console: Console.
-
Select Project: Ensure your project is selected.
-
Enable APIs:
- Navigate to APIs & Services > Library.
- Enable Gmail API and Google Calendar API.
-
Configure OAuth Consent Screen
- Click Create credentials > OAuth client ID.
- Choose Desktop Application
- Add Scopes :
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/calender.events.owned
-
Go to Credentials: APIs & Services > Credentials.
- Download the json file containing credentials
- Rename it to credentials.json
- Put it inside file location with cfdate.py
For Additional Help, refer to official documentation/youtube videos on configuring google api
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
pip install pytz
pip install tzdata
Use your timezone in place for Asia/Dhaka
LOCAL_TIMEZONE = 'Asia/Dhaka' # Use your timezoneCurrently the script is will only look for Div 2, Div 3 or Div 4 contests in the last 14 days. Feel free to tweak it to your needs.
python cfdate.py
Sign in with Google and Give user permissions