Bug fixes
This commit is contained in:
		| @@ -9,6 +9,7 @@ from bs4 import BeautifulSoup | ||||
|  | ||||
| import settings | ||||
| from feeds import hackernews, reddit, tildes, manual, lobsters | ||||
| import utils | ||||
|  | ||||
| INVALID_DOMAINS = ['youtube.com', 'bloomberg.com', 'wsj.com', 'sec.gov'] | ||||
| TWO_DAYS = 60*60*24*2 | ||||
|   | ||||
| @@ -50,7 +50,7 @@ def unix(date_str): | ||||
| def make_comment(i): | ||||
|     c = {} | ||||
|     try: | ||||
|         c['author'] = i['commenting_user']['username'] | ||||
|         c['author'] = i['commenting_user'] | ||||
|     except KeyError: | ||||
|         c['author'] = '' | ||||
|     c['score'] = i.get('score', 0) | ||||
|   | ||||
| @@ -10,11 +10,11 @@ from bleach.sanitizer import Cleaner | ||||
|  | ||||
| def alert_tanner(message): | ||||
|     try: | ||||
|         logger.info('Alerting Tanner: ' + message) | ||||
|         logging.info('Alerting Tanner: ' + message) | ||||
|         params = dict(qotnews=message) | ||||
|         requests.get('https://tbot.tannercollin.com/message', params=params, timeout=4) | ||||
|     except BaseException as e: | ||||
|         logger.error('Problem alerting Tanner: ' + str(e)) | ||||
|         logging.error('Problem alerting Tanner: ' + str(e)) | ||||
|  | ||||
| def gen_rand_id(): | ||||
|     return ''.join(random.choice(string.ascii_uppercase) for _ in range(4)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user