Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- from Random_select import Tweet
- from mkb import MarkovBot
- tweetbot = MarkovBot()
- #import markovbot
- #tweetbot = markovbot.MarkovBot()
- # Get the current directory's path
- dirname = os.path.dirname(os.path.abspath('twitterbot'))
- # Construct the path to the book
- book = os.path.join(dirname, 'frankocean.txt')
- # Make your bot read the book!
- tweetbot.read(book)
- #my_first_text = tweetbot.generate_text(25, seedword=['dream', 'psychoanalysis'])
- #print("tweetbot says:")
- #print(my_first_text)
- # ALL YOUR SECRET STUFF!
- # Consumer Key (API Key)
- cons_key = '**********'
- # Consumer Secret (API Secret)
- cons_secret = '**********'
- # Access Token
- access_token = '**************'
- # Access Token Secret
- access_token_secret = '****************'
- def randomSuffix():
- lst = []
- for i in range(100):
- lst.append(Tweet())
- return lst
- # Log in to Twitter
- tweetbot.twitter_login(cons_key, cons_secret, access_token, access_token_secret)
- tweetbot.twitter_tweeting_start(days=0, hours=0, minutes=15, keywords=None, prefix= 'Local Cincinnati boy', suffix=randomSuffix())
- secsinweek = 7 * 24 * 60 * 60
- day = secsinweek / 7
- time.sleep(day)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement