Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Twint
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
Twint
Commits
ccc556a6
Commit
ccc556a6
authored
May 26, 2019
by
Francesco Poldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scrape popular tweets
parent
6f70f6af
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
twint/cli.py
twint/cli.py
+2
-0
twint/config.py
twint/config.py
+2
-1
twint/url.py
twint/url.py
+3
-2
No files found.
twint/cli.py
View file @
ccc556a6
...
@@ -108,6 +108,7 @@ def initialize(args):
...
@@ -108,6 +108,7 @@ def initialize(args):
c
.
Retweets
=
args
.
retweets
c
.
Retweets
=
args
.
retweets
c
.
Get_replies
=
args
.
get_replies
c
.
Get_replies
=
args
.
get_replies
c
.
Custom_query
=
args
.
custom_query
c
.
Custom_query
=
args
.
custom_query
c
.
Popular_tweets
=
args
.
popular_tweets
return
c
return
c
def
options
():
def
options
():
...
@@ -191,6 +192,7 @@ def options():
...
@@ -191,6 +192,7 @@ def options():
help
=
"Automatically clean Pandas dataframe at every scrape."
)
help
=
"Automatically clean Pandas dataframe at every scrape."
)
ap
.
add_argument
(
"--get-replies"
,
help
=
"All replies to the tweet."
,
action
=
"store_true"
)
ap
.
add_argument
(
"--get-replies"
,
help
=
"All replies to the tweet."
,
action
=
"store_true"
)
ap
.
add_argument
(
"-cq"
,
"--custom-query"
,
help
=
"Custom search query."
)
ap
.
add_argument
(
"-cq"
,
"--custom-query"
,
help
=
"Custom search query."
)
ap
.
add_argument
(
"-pt"
,
"--popular-tweets"
,
help
=
"Scrape popular tweets instead of recent ones."
,
action
=
"store_true"
)
args
=
ap
.
parse_args
()
args
=
ap
.
parse_args
()
return
args
return
args
...
...
twint/config.py
View file @
ccc556a6
...
@@ -63,4 +63,5 @@ class Config:
...
@@ -63,4 +63,5 @@ class Config:
Hide_output
=
False
Hide_output
=
False
Get_replies
=
False
Get_replies
=
False
Near
=
""
Near
=
""
Custom_query
=
""
Custom_query
=
""
\ No newline at end of file
Popular_tweets
=
False
\ No newline at end of file
twint/url.py
View file @
ccc556a6
...
@@ -59,8 +59,8 @@ async def Profile(username, init):
...
@@ -59,8 +59,8 @@ async def Profile(username, init):
async
def
Search
(
config
,
init
):
async
def
Search
(
config
,
init
):
logme
.
debug
(
__name__
+
':Search'
)
logme
.
debug
(
__name__
+
':Search'
)
url
=
f
"{base}/search/timeline"
url
=
f
"{base}/search/timeline"
q
=
""
params
=
[
params
=
[
(
'f'
,
'tweets'
),
(
'vertical'
,
'default'
),
(
'vertical'
,
'default'
),
(
'src'
,
'unkn'
),
(
'src'
,
'unkn'
),
(
'include_available_features'
,
'1'
),
(
'include_available_features'
,
'1'
),
...
@@ -68,7 +68,8 @@ async def Search(config, init):
...
@@ -68,7 +68,8 @@ async def Search(config, init):
(
'max_position'
,
str
(
init
)),
(
'max_position'
,
str
(
init
)),
(
'reset_error_state'
,
'false'
),
(
'reset_error_state'
,
'false'
),
]
]
q
=
""
if
not
config
.
Popular_tweets
:
params
.
append
((
'f'
,
'tweets'
))
if
config
.
Lang
:
if
config
.
Lang
:
params
.
append
((
"l"
,
config
.
Lang
))
params
.
append
((
"l"
,
config
.
Lang
))
params
.
append
((
"lang"
,
"en"
))
params
.
append
((
"lang"
,
"en"
))
...
...
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