Skip to content

Twitter bot that sends daily tweets of joy throughout December

License

Notifications You must be signed in to change notification settings

PyLadiesBerlin/advent_twitter_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyLadies Advent

Description

This is the code for the PyLadies advent, a Twitter bot that posts a resource everyday during December.

Adding tips to tweet

Tips and resources to tweet can be added to the CSV in src/data/advent_data.csv. In PyLadies Berlin google sheets there is an online copy of this which can be downloaded.

Local setup

This project has been written using Python 3.9, the easiest way to run it locally is to create a virtual env using venv and run all the commands within the virtual environment.

Create virtual environment

python3.9 -m venv venv

Activate virtual environment

venv\Scripts\activate
# or on linux
source venv/bin/activate

Deactivate virtual environment

deactivate

Intall Requirements

# after activating the virtual env
pip install -r requirements.txt

Handling secrets and environment variables

Copy the .env.template file and rename it to .env add your secrets here. These values will then be loaded as environment variables and used to create a config object in the config package.

Running locally

python src/main.py

Linting

This project is linted using both Black and Pycodestyle. Both can be installed locally and ran with the following commands.

black .
pycodestyle .

Use autopep8 to automatically lint the code.

autopep8 --in-place --aggressive --aggressive .\script_name.py

Configuration for pycodestyle can be found in the ./setup.cfg file. The linters will also run as github actions when code is pushed to Github.

Deployment

This github repo is connected to the PyLadies Berlin Heroku account, new versions are automatically deployed from the main branch when code is pushed there. The Heroku Scheduler runs the code once per day.

Creative Commons License

This project is under the MIT creative commons license. It's code has been influenced, inspired and in parts taken from the project Named After Men by Tai Linhares.

About

Twitter bot that sends daily tweets of joy throughout December

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages