Posts from twitter are displayed properly
This commit is contained in:
		| @@ -6,7 +6,7 @@ import sys | ||||
|  | ||||
| APP_LOG_FILE = 'debug.log' | ||||
| ERROR_LOG_FILE = "error.log" | ||||
| MESSAGE_FORMAT = "%(asctime)s %(name)s %(levelname)s: %(message)s" | ||||
| MESSAGE_FORMAT = u"%(asctime)s %(name)s %(levelname)s: %(message)s" | ||||
| DATE_FORMAT = u"%d/%m/%Y %H:%M:%S" | ||||
|  | ||||
| formatter = logging.Formatter(MESSAGE_FORMAT.decode("utf-8"), datefmt=DATE_FORMAT) | ||||
|   | ||||
| @@ -3,7 +3,8 @@ | ||||
| import os | ||||
| import requests | ||||
| import re | ||||
|  | ||||
| import logging | ||||
| log = logging.getLogger("utils") | ||||
| url_re = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ ]*") | ||||
| bad_chars = '\'\\.,[](){}:;"' | ||||
|  | ||||
| @@ -56,4 +57,5 @@ def download_file(url, local_filename, window): | ||||
| def clean_text(text): | ||||
| 	""" Replaces all HTML entities and put the plain text equivalent if it's possible.""" | ||||
| 	text = text.replace("<br>", "\n") | ||||
| 	text = text.replace("\\n", "\n") | ||||
| 	return text  | ||||
		Reference in New Issue
	
	Block a user