Skip to content

redditdota/reddit-twitter-bot

Repository files navigation

r/Dota2 Twitter Bot

Setup

Install poetry

pip install --user poetry

Create python virtual environment

poetry install

Activate environment

poetry shell

Required Tokens

API tokens in tokens.py:

# Imgur API keys
IMGUR_CLIENT_ID = ...
IMGUR_CLIENT_SECRET = ...

# Reddit API keys
REDDIT_CLIENT_SECRET = ...
REDDIT_CLIENT_ID = ...

# Gfycat API keys
GFYCAT_CLIENT_ID = ...
GFYCAT_CLIENT_SECRET = ...

Subreddit specific tokens in dota2.py:

# Twitter API keys
TWITTER_ACCESS_TOKEN = ...
TWITTER_ACCESS_TOKEN_SECRET = ...
TWITTER_CONSUMER_KEY = ...
TWITTER_CONSUMER_SECRET = ...

# Place the subreddit you want to look up posts from here
SUBREDDIT = 'dota2'
HASHTAG = '#dota2'

Running the bot

python reddit_twitter_bot.py dota2