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
b57a1f2a
Commit
b57a1f2a
authored
Feb 21, 2018
by
Cody Zacharias
Committed by
GitHub
Feb 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26 from hpiedcoq/patch-1
Added a -g option for geocoded tweets
parents
7cca3f14
f7ed30f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tweep.py
tweep.py
+7
-1
No files found.
tweep.py
View file @
b57a1f2a
...
@@ -11,6 +11,8 @@ import json
...
@@ -11,6 +11,8 @@ import json
import
re
import
re
import
sys
import
sys
async
def
getUrl
(
init
):
async
def
getUrl
(
init
):
if
init
==
-
1
:
if
init
==
-
1
:
url
=
"https://twitter.com/search?f=tweets&vertical=default&lang=en&q="
url
=
"https://twitter.com/search?f=tweets&vertical=default&lang=en&q="
...
@@ -21,6 +23,9 @@ async def getUrl(init):
...
@@ -21,6 +23,9 @@ async def getUrl(init):
if
arg
.
u
!=
None
:
if
arg
.
u
!=
None
:
url
+=
"from
%3
A{0.u}"
.
format
(
arg
)
url
+=
"from
%3
A{0.u}"
.
format
(
arg
)
if
arg
.
g
!=
None
:
arg
.
g
=
arg
.
g
.
replace
(
" "
,
""
)
url
+=
"geocode
%3
A{0.g}"
.
format
(
arg
)
if
arg
.
s
!=
None
:
if
arg
.
s
!=
None
:
arg
.
s
=
arg
.
s
.
replace
(
" "
,
"
%20
"
)
.
replace
(
"#"
,
"
%23
"
)
arg
.
s
=
arg
.
s
.
replace
(
" "
,
"
%20
"
)
.
replace
(
"#"
,
"
%23
"
)
url
+=
"
%20
{0.s}"
.
format
(
arg
)
url
+=
"
%20
{0.s}"
.
format
(
arg
)
...
@@ -167,6 +172,7 @@ if __name__ == "__main__":
...
@@ -167,6 +172,7 @@ if __name__ == "__main__":
ap
.
add_argument
(
"-u"
,
help
=
"User's Tweets you want to scrape."
)
ap
.
add_argument
(
"-u"
,
help
=
"User's Tweets you want to scrape."
)
ap
.
add_argument
(
"-s"
,
help
=
"Search for Tweets containing this word or phrase."
)
ap
.
add_argument
(
"-s"
,
help
=
"Search for Tweets containing this word or phrase."
)
ap
.
add_argument
(
"-o"
,
help
=
"Save output to a file."
)
ap
.
add_argument
(
"-o"
,
help
=
"Save output to a file."
)
ap
.
add_argument
(
"-g"
,
help
=
"Search for geocoded tweets."
)
ap
.
add_argument
(
"--year"
,
help
=
"Filter Tweets before specified year."
)
ap
.
add_argument
(
"--year"
,
help
=
"Filter Tweets before specified year."
)
ap
.
add_argument
(
"--since"
,
help
=
"Filter Tweets sent since date (Example: 2017-12-27)."
)
ap
.
add_argument
(
"--since"
,
help
=
"Filter Tweets sent since date (Example: 2017-12-27)."
)
ap
.
add_argument
(
"--fruit"
,
help
=
"Display 'low-hanging-fruit' Tweets."
,
action
=
"store_true"
)
ap
.
add_argument
(
"--fruit"
,
help
=
"Display 'low-hanging-fruit' Tweets."
,
action
=
"store_true"
)
...
@@ -184,4 +190,4 @@ if __name__ == "__main__":
...
@@ -184,4 +190,4 @@ if __name__ == "__main__":
check
()
check
()
loop
=
asyncio
.
get_event_loop
()
loop
=
asyncio
.
get_event_loop
()
loop
.
run_until_complete
(
main
())
loop
.
run_until_complete
(
main
())
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