From 06831dfb5221af592d8a4e0469e9e00182b6de7b Mon Sep 17 00:00:00 2001 From: Alessio Date: Sun, 22 Aug 2021 18:29:58 -0700 Subject: [PATCH] Update help message --- cmd/twitter/helpers.go | 33 +++++++++++++++++++++++++-------- cmd/twitter/main.go | 6 +++--- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/cmd/twitter/helpers.go b/cmd/twitter/helpers.go index 581265c..5a7d622 100644 --- a/cmd/twitter/helpers.go +++ b/cmd/twitter/helpers.go @@ -14,19 +14,36 @@ import ( * Help message to print if command syntax is incorrect */ const help_message = `Usage: twitter [--profile ] +This application downloads tweets from twitter and saves them in a SQLite database. + +: + 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 is "create_profile". : - - create_profile ( is the directory to create). - must not exist. will be ignored if provided. + create_profile + is the directory to create. It must not exist already. + will be ignored if provided. - - fetch_user ( is the user handle) - - download_user_content ( is the user handle of the user whomst banner image and profile to download / back up) + fetch_user + download_user_content + is the user handle. + "download_user_content" will save a local copy of the user's banner and profile images. - - fetch_tweet_only ( is the full URL of the tweet) - - get_user_tweets ( is the user handle whomst feed to get) - - download_tweet_content ( is the ID of the tweet whomst contents to download / back up) + fetch_tweet + fetch_tweet_only + 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. -: the path to the directory containing the data directories, database files, and settings files. By default, refers to the current directory. Ignored if is "create_profile". + download_tweet_content + is the ID of the tweet. Downloads videos and images embedded in the tweet. + + get_user_tweets + get_user_tweets_all + is the user handle. + Gets the most recent ~50 tweets. + If "get_user_tweets_all" is used, gets up to ~3200 tweets (API limit). ` diff --git a/cmd/twitter/main.go b/cmd/twitter/main.go index a8d96b3..518f7ac 100644 --- a/cmd/twitter/main.go +++ b/cmd/twitter/main.go @@ -20,7 +20,7 @@ var profile persistence.Profile */ func main() { if len(os.Args) < 3 { - die("", true, 1) + die("", true, 0) } profile_dir := flag.String("profile", ".", "TODO USAGE") @@ -50,6 +50,8 @@ func main() { create_profile(target) case "fetch_user": fetch_user(scraper.UserHandle(target)) + case "download_user_content": + download_user_content(scraper.UserHandle(target)) case "fetch_tweet_only": fetch_tweet_only(target) case "fetch_tweet": @@ -60,8 +62,6 @@ func main() { fetch_user_feed(target, 999999999) case "download_tweet_content": download_tweet_content(target) - case "download_user_content": - download_user_content(scraper.UserHandle(target)) default: die("Invalid operation: " + operation, true, 3) }