Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Replace --fruit with --email and --phone. Fix #289
Browse files Browse the repository at this point in the history
  • Loading branch information
haccer committed Nov 11, 2018
1 parent 9bf4732 commit bab8da3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -62,7 +62,7 @@ A few simple examples to help you understand the basics:
- `python3 Twint.py -u username --since 2015-12-20` - Collect Tweets that were tweeted since 2015-12-20.
- `python3 Twint.py -u username -o file.txt` - Scrape Tweets and save to file.txt.
- `python3 Twint.py -u username -o file.csv --csv` - Scrape Tweets and save as a csv file.
- `python3 Twint.py -u username --fruit` - Show Tweets with low-hanging fruit.
- `python3 Twint.py -u username --email --phone` - Show Tweets that might have phone numbers or email addresses.
- `python3 Twint.py -s "Donald Trump" --verified` - Display Tweets by verified users that Tweeted about Donald Trump.
- `python3 Twint.py -g="48.880048,2.385939,1km" -o file.csv --csv` - Scrape Tweets from a radius of 1km around a place in Paris and export them to a csv file.
- `python3 Twint.py -u username -es localhost:9200` - Output Tweets to Elasticsearch
Expand Down
6 changes: 4 additions & 2 deletions Twint.py
Expand Up @@ -69,7 +69,8 @@ def initialize(args):
c.Year = args.year
c.Since = args.since
c.Until = args.until
c.Fruit = args.fruit
c.Email = args.email
c.Phone = args.phone
c.Verified = args.verified
c.Store_csv = args.csv
c.Store_json = args.json
Expand Down Expand Up @@ -122,7 +123,8 @@ def options():
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("--until", help="Filter Tweets sent until date (Example: 2017-12-27).")
ap.add_argument("--fruit", help="Display 'low-hanging-fruit' Tweets.", action="store_true")
ap.add_argument("--email", help="Filter Tweets that might have email addresses", action="store_true")
ap.add_argument("--phone", help="Filter Tweets that might have phone numbers", action="store_true")
ap.add_argument("--verified", help="Display Tweets only from verified users (Use with -s).",
action="store_true")
ap.add_argument("--csv", help="Write as .csv file.", action="store_true")
Expand Down
3 changes: 2 additions & 1 deletion twint/config.py
Expand Up @@ -12,7 +12,8 @@ class Config:
Year = None
Since = None
Until = None
Fruit = False
Email = False
Phone = False
Verified = False
Store_csv = False
Store_json = False
Expand Down
10 changes: 5 additions & 5 deletions twint/url.py
Expand Up @@ -82,11 +82,11 @@ async def Search(config, init):
q += f" since:{config.Since}"
if config.Until:
q += f" until:{config.Until}"
if config.Fruit:
url += ' "myspace.com" OR "last.fm" OR'
url += ' "mail" OR "email" OR "gmail" OR "e-mail"'
# url += "%20OR%20%22phone%22%20OR%20%22call%20me%22%20OR%20%22text%20me%22"
# url += "%20OR%20%22keybase%22"
if config.Email:
q += ' "mail" OR "email" OR'
q += ' "gmail" OR "e-mail"'
if config.Phone:
q += ' "phone" OR "call me" OR "text me"'
if config.Verified:
q += " filter:verified"
if config.To:
Expand Down

0 comments on commit bab8da3

Please sign in to comment.