Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
shadowban-eu-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
shadowban-eu-backend
Commits
8f91a6a8
Commit
8f91a6a8
authored
Dec 16, 2020
by
Raphael Beer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove: wikileaks cache/watch
Reverts
dab877d9
parent
04006c7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
8 deletions
+1
-8
backend.py
backend.py
+0
-4
db.py
db.py
+1
-4
No files found.
backend.py
View file @
8f91a6a8
...
...
@@ -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
)
...
...
db.py
View file @
8f91a6a8
...
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment