Created
December 11, 2017 03:29
-
-
Save jwinterm/0bd8be11233ed195522d6bcee5159c18 to your computer and use it in GitHub Desktop.
Main price ticker file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imggen | |
import praw | |
from datetime import datetime | |
from userpw import * | |
try: | |
tickerimg = imggen.imggen() | |
with open('pyticker.log', 'a') as f: | |
f.write("{} - successfully created ticker image\n".format(str(datetime.now()))) | |
except: | |
with open('pyticker.log', 'a') as f: | |
f.write("{} - failed to created ticker image\n".format(str(datetime.now()))) | |
try: | |
reddit = praw.Reddit(client_id=client_id, client_secret=client_secret, | |
username=username, password=password, | |
user_agent=user_agent) | |
print(reddit.user.me()) | |
sub = reddit.subreddit('groestlcoin') | |
# print(sub.title) | |
ss = sub.stylesheet() | |
sstext = ss.stylesheet | |
sub.stylesheet.upload("ticker", "img/temp/ticker.png") | |
sub.stylesheet.update(sstext) | |
with open('pyticker.log', 'a') as f: | |
f.write("{} - successfully updated reddit\n".format(str(datetime.now()))) | |
except: | |
with open('pyticker.log', 'a') as f: | |
f.write("{} - failed to update reddit\n".format(str(datetime.now()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment