Skip to content

A small python bot set up to tweet on particular day(s) every 12 months.

Notifications You must be signed in to change notification settings

freejoe76/spring-is

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Is Here bot

For tweeting out something every so often for as long as your server lasts.

Usage

How to set up a dev environment

  1. To create a virtual environment using python3, run something like python3 -m venv SPRING.
  2. cd to the project root
  3. pip3 install -r requirements.txt

Once you're there, you'll need to hook up twitter to this. With the twitter account you intend to use this on:

  1. Go to https://developer.twitter.com/en/apps
  2. Create a new app
  3. Click the Keys and Access Tokens tab, create an Access Token.
  4. Get that access token and its secret, as well as the consumer key and secret.
  5. Take those variables listed above and make them available to your environment, maybe like this:
export ACCESS_TOKEN='blah-blah'
export ACCESS_SECRET='blah'
export CONSUMER_KEY='blah'
export CONSUMER_SECRET='blah'

And once you've done that you'll need to run the initial setup: python here.py --initial. This creates the text files and puts the defaults in them.

How to run the script

Once a day, on a crontab maybe, run python3 here.py --story [name-of-story-as-set-in-your-json-filename] note that the story name is the filename of the json file in the story directory, minus the file extension.

About

A small python bot set up to tweet on particular day(s) every 12 months.

Topics

Resources

Stars

Watchers

Forks

Languages