Update help message

This commit is contained in:
Alessio 2021-08-22 18:29:58 -07:00
parent 1f5ebf9f8d
commit 06831dfb52
2 changed files with 28 additions and 11 deletions

View File

@ -14,19 +14,36 @@ import (
* Help message to print if command syntax is incorrect * Help message to print if command syntax is incorrect
*/ */
const help_message = `Usage: twitter [--profile <profile_dir>] <operation> <TARGET> const help_message = `Usage: twitter [--profile <profile_dir>] <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".
<operation>: <operation>:
- create_profile (<TARGET> is the directory to create). create_profile
<TARGET> must not exist. <profile_dir> will be ignored if provided. <TARGET> is the directory to create. It must not exist already.
<profile_dir> will be ignored if provided.
- fetch_user (<TARGET> is the user handle) fetch_user
- download_user_content (<TARGET> is the user handle of the user whomst banner image and profile to download / back up) 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_only (<TARGET> is the full URL of the tweet) fetch_tweet
- get_user_tweets (<TARGET> is the user handle whomst feed to get) fetch_tweet_only
- download_tweet_content (<TARGET> is the ID of the tweet whomst contents to download / back up) <TARGET> is the full URL of the tweet.
If using "fetch_tweet_only", then only that specific tweet will be saved. "fetch_tweet" will save the whole thread including replies.
<profile_dir>: the path to the directory containing the data directories, database files, and settings files. By default, refers to the current directory. Ignored if <operation> is "create_profile". download_tweet_content
<TARGET> is the ID of the tweet. 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).
` `

View File

@ -20,7 +20,7 @@ var profile persistence.Profile
*/ */
func main() { func main() {
if len(os.Args) < 3 { if len(os.Args) < 3 {
die("", true, 1) die("", true, 0)
} }
profile_dir := flag.String("profile", ".", "TODO USAGE") profile_dir := flag.String("profile", ".", "TODO USAGE")
@ -50,6 +50,8 @@ func main() {
create_profile(target) create_profile(target)
case "fetch_user": case "fetch_user":
fetch_user(scraper.UserHandle(target)) fetch_user(scraper.UserHandle(target))
case "download_user_content":
download_user_content(scraper.UserHandle(target))
case "fetch_tweet_only": case "fetch_tweet_only":
fetch_tweet_only(target) fetch_tweet_only(target)
case "fetch_tweet": case "fetch_tweet":
@ -60,8 +62,6 @@ func main() {
fetch_user_feed(target, 999999999) fetch_user_feed(target, 999999999)
case "download_tweet_content": case "download_tweet_content":
download_tweet_content(target) download_tweet_content(target)
case "download_user_content":
download_user_content(scraper.UserHandle(target))
default: default:
die("Invalid operation: " + operation, true, 3) die("Invalid operation: " + operation, true, 3)
} }