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
6e5155b9
Commit
6e5155b9
authored
Jan 23, 2022
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix search ban not working
parent
6b7e5c6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
backend_requests.py
backend_requests.py
+16
-5
No files found.
backend_requests.py
View file @
6e5155b9
...
@@ -128,15 +128,26 @@ def searchban(screen_name):
...
@@ -128,15 +128,26 @@ def searchban(screen_name):
"more_replies"
:
{
"ban"
:
False
,
"tweet"
:
"-1"
,
"in_reply_to"
:
"-1"
}
"more_replies"
:
{
"ban"
:
False
,
"tweet"
:
"-1"
,
"in_reply_to"
:
"-1"
}
}
}
searchurl
=
"https://api.twitter.com/1.1/users/search.json"
#
searchurl = "https://api.twitter.com/1.1/users/search.json"
params
=
{
"q"
:
"from:
{}"
.
format
(
screen_name
),
"count"
:
1
}
# params = {"q": "from:@
{}".format(screen_name), "count": 1}
search
=
twitter_b
.
get
(
searchurl
,
params
=
params
)
.
json
()
#
search = twitter_b.get(searchurl, params=params).json()
# print(search)
# print(search)
if
len
(
search
)
==
0
:
# if len(search) == 0:
returnjson
[
"test"
][
"search"
]
=
"ban"
# returnjson["test"]["search"] = "ban"
# return returnjson
# else:
# return returnjson
searchurl_v2
=
"https://api.twitter.com/2/search/adaptive.json"
params_v2
=
{
"q"
:
"from:@{}"
.
format
(
screen_name
),
"count"
:
1
,
"spelling_corrections"
:
0
,
"tweet_search_mode"
:
"live"
}
search_v2
=
twitter_b
.
get
(
searchurl_v2
,
params
=
params_v2
)
.
json
()
search_tweets
=
search_v2
[
"globalObjects"
][
"tweets"
]
if
search_tweets
==
{}:
returnjson
[
"tests"
][
"search"
]
=
"ban"
return
returnjson
return
returnjson
else
:
else
:
return
returnjson
return
returnjson
print
(
search_v2
)
app
.
run
(
debug
=
False
,
port
=
os
.
environ
.
get
(
"PORT"
,
5000
),
host
=
"0.0.0.0"
)
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