A library built on top of Tweepy for making Twitter bots
Project description
Tweepy Parrot
A library built on top of Tweepy, designed to auto generate tweets from data sourced from other users.
A bot made with this library, will stream unique tweets and retweets of the users it follows and/or is followed by. It cleans and parses the words from the tweet into a growing Markov chain, which is later used to generate tweets.
Setup
pip install tweepy-parrot
To setup the bot, you must setup a Twitter developer account, and then either add the following to a .env
file in your project, or otherwise export them to the runtime environment.
TWITTER_API_KEY={YOUR_API_KEY}
TWITTER_API_SECRET={YOUR_API_SECRET}
TWITTER_ACCESS_TOKEN={BOT_ACCESS_TOKEN}
TWITTER_ACCESS_SECRET={BOT_ACCESS_SECRET}
Once done, you are ready to use the library.
Examples
A simple example that will store data in a JSON format, and echo Squawks to your terminal, rather than Tweet them out.
from time import sleep
from tweepy_parrot import JSONParrot, ParrotBot
my_parrot = JSONParrot('parrot.json')
my_bot = ParrotBot(my_parrot)
# Call start, to being listening to the data stream.
# follows=True will stream data from accounts the bot follows
# followers=True will stream data from accounts that follow the bot
my_bot.start(follows=False, followers=True)
while True:
sleep(3600) # One hour
print(my_bot.squawk(post=False))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tweepy_parrot-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c422dd0b493ba9c0ff744845089ee8f8f04f04090f3679721540b1dcb0b0b13d |
|
MD5 | 764d00cc35f954d0373884dd8225e74e |
|
BLAKE2b-256 | 9b774537c7c67524951e2591ddebdd3aa24fd62a19f4f5c53320d154fed4d6c5 |