-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
24 lines (18 loc) · 873 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
import threading
from internal.api.reddit import RedditScraper
from internal.unixporn.unixporn import Unixporn
class Bot:
def __init__(self):
self.reddit_client = RedditScraper(user_agent=os.environ['REDDIT_USERNAME'],
client_id=os.environ['REDDIT_CLIENT_ID'],
client_secret=os.environ['REDDIT_CLIENT_SECRET'],
username=os.environ['REDDIT_USERNAME'],
password=os.environ['REDDIT_PASSWORD'])
self.unixporn = Unixporn()
self.thread_post_tweet_daily = threading.Thread(target=self.unixporn.post_tweet_daily,args=(self.reddit_client,))
def start(self):
self.thread_post_tweet_daily.start()
if __name__ == '__main__':
bot = Bot()
bot.start()