Commit 8f91a6a8 authored by Raphael Beer's avatar Raphael Beer

Remove: wikileaks cache/watch

  Reverts dab877d9
parent 04006c7a
......@@ -51,10 +51,6 @@ async def unlocked(request):
@routes.get('/{screen_name}')
async def api(request):
screen_name = request.match_info['screen_name']
if screen_name == "wikileaks" and request.query_string != "watch":
log.debug("[wikileaks] Returning last watch result")
db_result = db.get_result_by_screen_name("wikileaks")
return web.json_response(db_result, headers={"Access-Control-Allow-Origin": args.cors_allow})
session = TwitterSession.guest_sessions[TwitterSession.test_index % len(TwitterSession.guest_sessions)]
TwitterSession.test_index += 1
result = await session.test(screen_name)
......
......@@ -2,7 +2,7 @@ import copy
import traceback
import sys
from time import sleep
from pymongo import MongoClient, errors as MongoErrors, DESCENDING
from pymongo import MongoClient, errors as MongoErrors
from log import log
......@@ -34,9 +34,6 @@ class Database:
def write_rate_limit(self, data):
self.rate_limits.insert_one(data)
def get_result_by_screen_name(self, screen_name):
return self.results.find_one({ "profile.screen_name": screen_name }, sort=[("_id", DESCENDING)], projection={"_id": False})
def close(self):
self.client.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment