Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ venv.bak/

# mypy
.mypy_cache/

#ignore pycache
__pycache__

#ignore credentials
config.json
Empty file added __init__.py
Empty file.
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Email for account:
[email protected]

Twitter for account:
@con_theory_bot
2 changes: 1 addition & 1 deletion template.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PERSON is a lizard person in diguises
PERSON is a lizard person in diguise
PERSON is three kids in a trench coat
PERSON had an affair with PERSON
PERSON is Bansky
6 changes: 4 additions & 2 deletions testBot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import random
from tweet import twitter_bot


def remove_slash_ns(input_list):
Expand Down Expand Up @@ -30,5 +31,6 @@ def find_and_replace(person, template):
if __name__ == "__main__":
people_list, template_list = (
createLists("people.txt", "template.txt")
)
print(find_and_replace(random.choice(people_list), random.choice(template_list)))
)
con_bot = twitter_bot()
con_bot.send_tweet(find_and_replace(random.choice(people_list), random.choice(template_list))
20 changes: 20 additions & 0 deletions tweet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import tweepy
import json

print("this is my twitter bot")

class twitter_bot():
def __init__(self):
with open("config.json") as file:
data = json.load(file)
self.CONSUMER_KEY = data["CONSUMER_KEY"]
self.CONSUMER_SECRET = data["CONSUMER_SECRET"]
self.ACCESS_KEY = data["ACCESS_KEY"]
self.ACCESS_SECRET = data["ACCESS_SECRET"]

auth = tweepy.OAuthHandler(self.CONSUMER_KEY, self.CONSUMER_SECRET)
auth.set_access_token(self.ACCESS_KEY, self.ACCESS_SECRET)
self.api = tweepy.API(auth)

def send_tweet(self, input):
self.api.update_status(input)