119 lines
4.8 KiB
Plaintext
119 lines
4.8 KiB
Plaintext
Usage: twitter [--profile <profile_dir>] [--session <session_name>] [<flags>] <operation> <TARGET>
|
|
This application downloads tweets from twitter and saves them in a SQLite database.
|
|
|
|
<profile_dir>:
|
|
Optional. Indicates the path to the directory containing the data directories, database files, and settings files.
|
|
By default, will use the current working directory.
|
|
Ignored if <operation> is "create_profile".
|
|
|
|
<session_name>:
|
|
Optional. Only needed when making authenticated requests.
|
|
If specified, the named session file (this value, appended with ".session" extension) will be used
|
|
when making API requests.
|
|
|
|
<operation>:
|
|
create_profile
|
|
<TARGET> is the directory to create. It must not exist already.
|
|
<profile_dir> will be ignored if provided.
|
|
|
|
login
|
|
<TARGET> is the username or email to log in as.
|
|
An optional second target can be provided which will be used as the password; if not, a password
|
|
prompt (non-echoing) will be given so you can enter the password.
|
|
On success, the `login` operation will create (or overwrite) a ".session" file with the user
|
|
handle of the user it corresponds to, which contains session tokens and cookies allowing you to
|
|
make subsequent requests as that user.
|
|
For example, `twitter login offline_twatter` will prompt for a password, then attempt to log in as
|
|
@offline_twatter, and if successful, a file `Offline_Twatter.session` will be created.
|
|
It may be converted to uppercase (offline_twatter => Offline_Twatter) if that's the canonical
|
|
capitalization that twitter uses, even though handles are case insensitive.
|
|
|
|
|
|
fetch_user
|
|
download_user_content
|
|
<TARGET> is the user handle.
|
|
"download_user_content" will save a local copy of the user's banner and profile images.
|
|
|
|
fetch_tweet
|
|
fetch_tweet_only
|
|
<TARGET> is either the full URL of the tweet, or its ID.
|
|
If using "fetch_tweet_only", then only that specific tweet will be saved. "fetch_tweet" will save the whole
|
|
thread including replies.
|
|
|
|
download_tweet_content
|
|
<TARGET> is either the full URL of the tweet, or its ID.
|
|
Downloads videos and images embedded in the tweet.
|
|
|
|
get_user_tweets
|
|
get_user_tweets_all
|
|
<TARGET> is the user handle.
|
|
Gets the most recent ~50 tweets.
|
|
If "get_user_tweets_all" is used, gets up to ~3200 tweets (API limit).
|
|
|
|
get_user_likes
|
|
get_user_likes_all
|
|
<TARGET> is the user handle.
|
|
Gets the most recent ~50 "likes".
|
|
If "get_user_tweets_all" is used, gets up to ~3200 "liked" tweets (API limit).
|
|
|
|
get_followers
|
|
get_followees
|
|
<TARGET> is the user handle of whose followers/followees to get.
|
|
"get_followers" gets the list of people following that user.
|
|
"get_followees" gets the list of people that user is following.
|
|
|
|
fetch_timeline
|
|
fetch_timeline_following_only
|
|
Fetch the logged-in user's timeline (home feed).
|
|
No <TARGET> is needed; will be ignored if given.
|
|
Twitter keeps renaming the feeds, but the two options are:
|
|
- "fetch_timeline" uses Twitter's "algorithm", including recommendations, promoted content, etc
|
|
- "fetch_timeline_following_only" is just tweets from people you follow, in the order they were
|
|
posted (skips the "algorithm")
|
|
|
|
follow
|
|
unfollow
|
|
<TARGET> is the user handle
|
|
|
|
search
|
|
<TARGET> is the search query. Should be wrapped in quotes if it has spaces.
|
|
(Requires authentication)
|
|
|
|
like_tweet
|
|
unlike_tweet
|
|
"Like" or un-"like" the tweet indicated by <TARGET>.
|
|
(Requires authentication)
|
|
|
|
|
|
fetch_inbox
|
|
Update all DMs.
|
|
<TARGET> is ignored.
|
|
|
|
fetch_dm
|
|
Update a specific DM chat room.
|
|
<TARGET> is the chat room ID to update
|
|
|
|
send_dm
|
|
Send a DM.
|
|
<TARGET> is the chat room ID to send the DM to.
|
|
An additional argument is required after <TARGET>, which is the text of the message to send.
|
|
Another additional argument can be added, which is the message ID that this new message is
|
|
in reply to.
|
|
|
|
|
|
webserver
|
|
Start a webserver that serves a web UI to browse the tweet archive
|
|
|
|
<flags>:
|
|
-h, --help
|
|
Print this message, then exit.
|
|
|
|
-v, --version
|
|
Print the version number and exit.
|
|
|
|
-n, --number
|
|
Set the number of tweets to fetch, when getting a feed. Default is 50.
|
|
Setting this flag means you will get at least that many "tweets plus retweets" from that user (unless of
|
|
course they don't have that many). The total amount of tweets returned will be larger, because quoted tweets
|
|
won't count toward the limit.
|