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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9876140cc5dc4b0fcb0e096f0a45c3febb1a774fc0257665388ed95fd02c835 |
|
MD5 | 82fee69d4bdac0d8c716e87dd07e7249 |
|
BLAKE2b-256 | 4c7194be33ee783a4e211900508aa05bb78557c2d5be3d377aaeef18749e9e95 |