Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
0.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottl committed Nov 27, 2019
1 parent 7c9feba commit 4ede9ef
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion GetOldTweets3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import models
from . import manager

__version__ = '0.0.10'
__version__ = '0.0.11'
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ GetOldTweets3 --querysearch "europe refugees" --maxtweets 10
GetOldTweets3 --username "barackobama" --toptweets --maxtweets 10
```

**Example 3 - Get tweets by the username and bound dates** (until date is not included):
**Example 3 - Get tweets by the username and bound dates** (until date is not included) **and preserve emojis as unicode:**
```bash
GetOldTweets3 --username "barackobama" --since 2015-09-10 --until 2015-09-12 --maxtweets 10
GetOldTweets3 --username "barackobama" --since 2015-09-10 --until 2015-09-12 --maxtweets 10 --emoji unicode
```

**Example 4 - Get tweets by several usernames:**
Expand Down Expand Up @@ -109,12 +109,13 @@ tweet = got.manager.TweetManager.getTweets(tweetCriteria)[0]
print(tweet.text)
```

**Get tweets by username and bound dates:**
**Get tweets by username and bound dates and preserve emojis as unicode:**
``` python
tweetCriteria = got.manager.TweetCriteria().setUsername("barackobama")\
.setSince("2015-09-10")\
.setUntil("2016-01-01")\
.setMaxTweets(1)
.setMaxTweets(1)\
.setEmoji("unicode")
tweet = got.manager.TweetManager.getTweets(tweetCriteria)[0]
print(tweet.text)
```
Expand Down
31 changes: 17 additions & 14 deletions bin/GetOldTweets3
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""To use this script you can pass the following attributes:
querysearch: a query text to be matched
username: a username or a list of usernames (comma or space separated)
of a specific twitter account(s) (with or without @)
username-from-file: a file with a list of usernames,
since: a lower bound date in UTC (yyyy-mm-dd)
until: an upper bound date in UTC (yyyy-mm-dd) (not included)
near: a reference location area from where tweets were generated
within: a distance radius from "near" location (e.g. 15mi)
toptweets: only the tweets provided as top tweets by Twitter (no parameters required)
maxtweets: the maximum number of tweets to retrieve
lang: the language of tweets
output: a filename to export the results (default is "output_got.csv")
--querysearch: a query text to be matched
--username: a username or a list of usernames (comma or space separated)
of a specific twitter account(s) (with or without @)
--username-from-file: a file with a list of usernames,
--since: a lower bound date in UTC (yyyy-mm-dd)
--until: an upper bound date in UTC (yyyy-mm-dd) (not included)
--near: a reference location area from where tweets were generated
--within: a distance radius from "near" location (e.g. 15mi)
--toptweets: only the tweets provided as top tweets by Twitter (no parameters required)
--maxtweets: the maximum number of tweets to retrieve
--lang: the language of tweets
--emoji: "ignore" (the default, discards emojis), "unicode"
or "named" (replaces with "Emoji[Name of emoji]")
--output: a filename to export the results (default is "output_got.csv")
--debug: outputs debug information to standard error stream
Examples:
Expand All @@ -22,8 +25,8 @@ GetOldTweets3 --querysearch "europe refugees" --maxtweets 10
# Example 1 - Get the last 10 top tweets by username:
GetOldTweets3 --username "barackobama" --toptweets --maxtweets 10
# Example 3 - Get tweets by username and bound dates (until date is not included):
GetOldTweets3 --username "barackobama" --since 2015-09-10 --until 2015-09-12 --maxtweets 10
# Example 3 - Get tweets by username and bound dates (until date is not included) and preserve emojis as unicode:
GetOldTweets3 --username "barackobama" --since 2015-09-10 --until 2015-09-12 --maxtweets 10 --emoji unicode
# Example 4 - Get tweets by several usernames:
GetOldTweets3 --username "BarackObama,AngelaMerkeICDU" --usernames-from-file userlist.txt --maxtweets 10
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="GetOldTweets3",
version="0.0.10",
version="0.0.11",
author="Dmitry Mottl",
author_email="[email protected]",
license='MIT',
Expand All @@ -26,6 +26,7 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
Expand Down

0 comments on commit 4ede9ef

Please sign in to comment.