刘凡 9ff4d1d109 add S3,archive,truncate | 2 роки тому | |
---|---|---|
.. | ||
.gitignore | 2 роки тому | |
Pipfile | 2 роки тому | |
Pipfile.lock | 2 роки тому | |
Procfile | 2 роки тому | |
README.md | 2 роки тому | |
requirements.txt | 2 роки тому | |
runtime.txt | 2 роки тому | |
tl_icalendar.py | 2 роки тому |
Python script which converts TeamLiquid's XML calendar into iCalendar format to be used with Google Calendar and other calendar applications. Uploads calendar files for every event type to Amazon S3 bucket.
The script generates iCalendar files for every event type in TeamLiquid's calendar and uploads them into Amazon S3 bucket.
Currently available calendars (updated every 60 minutes):
If new event type appears in TeamLiquid calendar, the script will automatically create a new calendar for it.
Below steps describe how to use the calendars with Google Calendar.
https://s3.amazonaws.com/tl-icalendar/starcraft-2.ics
Add Calendar
, the calendar URL should appear in the sidebarStarCraft 2
, add event notifications etc...Create virtualenv with Python 3 for your project. Example using virtualenvwrapper:
mkvirtualenv -p python3 tl-icalendar
workon tl-icalendar
Clone the project and install project requirements into your virtualenv.
git clone https://github.com/mckdev/tl-icalendar/
cd tl-icalendar
pip install -r requirements.txt
If you want the S3 upload to work, create AWS configuration file in your user directory.
~/.aws/credentials
C:\Users\username\.aws\credentials
The content of the credentials
file should look like this:
[default]
aws_access_key_id = YOUR_AWS_ACCESS_KEY_ID
aws_secret_access_key = YOUR_AWS_SECRET_ACCESS_KEY
You will also need to create a bucket with public read access and modify BUCKET_NAME
variable inside tl-icalendar.py
to match your S3 bucket name.
The calendars are always stored locally in calendars/
directory, so if you don't want to use S3 upload, simply comment out the upload_calendars()
line inside run()
function.
Run the script with:
python tl_icalendar.py
This script is ready for Heroku + Amazon S3 deployment.
BUCKET_NAME
variable in the script to match your S3 bucket name.AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
config vars.heroku run python tl_icalendar.py
and check your S3 buckets for calendars.python tl_calendar.py
at your desired interval.