Save Imgur URL to database

This commit is contained in:
JonnyWong16 2016-02-21 09:34:51 -08:00
commit f663fac220
3 changed files with 107 additions and 70 deletions

View file

@ -856,6 +856,23 @@ class DataFactory(object):
return ip_address
def get_poster_url(self, rating_key=''):
monitor_db = database.MonitorDatabase()
if rating_key:
query = 'SELECT id, poster_url FROM notify_log WHERE rating_key = %d ' \
'ORDER BY id DESC LIMIT 1' % int(rating_key)
result = monitor_db.select(query)
else:
return None
poster_url = ''
for item in result:
poster_url = item['poster_url']
return poster_url
def get_search_query(self, rating_key=''):
monitor_db = database.MonitorDatabase()