Skip to main content

Karlsruher Twitter Robot

Project description

Karlsruher Twitter Robot

Karlsruher is a robot on Twitter that retweets followers who mention its name.


Install the latest version into Python 3 library:

python3 -m pip install -U --user --pre karlsruher

Still in Beta mode: you need to use --pre and expect a moving target.

The Robot needs:

  • a ROBOT_HOME directory:
    • database file: ROBOT_HOME/brain
    • lock file: ROBOT_HOME/lock
  • Twitter API credentials
    • in file ROBOT_HOME/auth.yaml

Create ROBOT_HOME and auth.yaml:

export ROBOT_HOME=$HOME/karlsruher
mkdir -p $ROBOT_HOME

cat >$ROBOT_HOME/auth.yaml <<EOF
# You must setup real credentials here:
    key: 'YOUR-ACCESS-KEY'
    secret: 'YOUR-ACCESS-SECRET'

Populate the database (brain)

The Robot needs to know its followers. Due to Twitter API rate limits, fetching followers may take up to 1 hour per 1000 followers. So if you have the time, import followers:

export ROBOT_HOME=$HOME/karlsruher
karlsruher --home=$ROBOT_HOME -housekeeping [-debug]

Run this once per day, nightly!

Once the Robot has followers imported, it can start to read its mention timeline:

export ROBOT_HOME=$HOME/karlsruher
karlsruher --home=$ROBOT_HOME -read [-debug]

If you're brave enough, go wild and let the Robot read its mention timeline and retweeting all appropriate tweets.

export ROBOT_HOME=$HOME/karlsruher
karlsruher --home=$ROBOT_HOME -talk [-debug]

Run this every 5 minutes or whatever interval you like.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
karlsruher-2.0b16.tar.gz (16.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page