Skip to content

omegapointnorge/aoc-python-slackbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code - Python SlackBot

Will post the leaderboard to Slack

How to set up

The app is hosted on https://www.pythonanywhere.com/, using the Hacker $5/month plan, because I want the script to run twice a day

File structure

  • /home/USERNAME/slack.py
  • /home/USERNAME/advent_of_code.py
  • /home/USERNAME/run.py

Task commands

The tasks run in UTC timezone, so in Norwegian winter-time, GMT+1, the times are 10:00 and 20:00

  • Daily 09:00 python /home/USERNAME/run.py <aoc_api_url> <aoc_session_cookie> <aoc_join_code> <slack_webhook_url>
  • Daily 19:00 python /home/USERNAME/run.py <aoc_api_url> <aoc_session_cookie> <aoc_join_code> <slack_webhook_url>

Environment variables/Arguments

  1. Create a Slackbot and get the webhook URL
    1. Should look like this: https://hooks.slack.com/services/<SECRET>/<SECRET>/<SECRET>
  2. Create a leaderboard on Advent of Code and get the API URL
    1. Should look like this: https://adventofcode.com/<year>/leaderboard/private/view/<ID>.json
    2. Get the join code
    3. Inspect element and find the header called Cookie and get the session value

About

Advent of Code Python Slack-bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages