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
5682dd30
Commit
5682dd30
authored
Jan 25, 2022
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search suggestion ban is now real value
parent
b873f3d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
backend_requests.py
backend_requests.py
+13
-5
No files found.
backend_requests.py
View file @
5682dd30
...
...
@@ -122,7 +122,7 @@ def searchban(screen_name):
# returnjson["profile"]["has_tweets"] = True
returnjson
[
"tests"
]
=
{
"search"
:
True
,
"search"
:
True
,
## Search ban
"typeahead"
:
True
,
## suggest ban
"ghost"
:
{
"ban"
:
False
},
"more_replies"
:
{
"ban"
:
False
,
"tweet"
:
"-1"
,
"in_reply_to"
:
"-1"
}
...
...
@@ -144,11 +144,19 @@ def searchban(screen_name):
search_tweets
=
search_v2
[
"globalObjects"
][
"tweets"
]
if
search_tweets
==
{}:
returnjson
[
"tests"
][
"search"
]
=
False
returnjson
[
"tests"
][
"typeahead"
]
=
False
return
returnjson
# returnjson["tests"]["typeahead"] = False
else
:
return
returnjson
print
(
search_v2
)
returnjson
[
"tests"
][
"search"
]
=
True
suggestions
=
twitter_b
.
get
(
"https://api.twitter.com/1.1/search/typeahead.json?src=search_box&result_type=users&q=@"
+
screen_name
)
try
:
returnjson
[
"tests"
][
"typeahead"
]
=
len
([
1
for
user
in
suggestions
[
"users"
]
if
user
[
"screen_name"
]
.
lower
()
==
screen_name
.
lower
()])
>
0
except
:
returnjson
[
"tests"
][
"typeahead"
]
=
False
return
returnjson
app
.
run
(
debug
=
False
,
port
=
os
.
environ
.
get
(
"PORT"
,
5000
),
host
=
"0.0.0.0"
)
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