Giter VIP home page Giter VIP logo

tweet.sh's Introduction

tweet.sh, a Twitter client written in simple Bash script

A one-file bash script Twitter Client (depending on some helper commands). This project is mainly started to demonstrating my shell scripting skills, so only limited features of Twitter APIs are supported.

Setup

You need to prepare API keys at first. Go to the front page, create a new app, and generate a new access token.

Then put them as a key file at ~/.tweet.client.key, with the format:

MY_SCREEN_NAME=xxxxxxxxxxxxxxxxxxx
MY_LANGUAGE=xx
CONSUMER_KEY=xxxxxxxxxxxxxxxxxxx
CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

If there is a key file named tweet.client.key or .tweet.client.key in the current directory, tweet.sh will load it. Otherwise, the file ~/.tweet.client.key will be used as the default key file.

Moreover, you can give those information via environment variables without a key file.

$ export MY_SCREEN_NAME=xxxxxxxxxxxxxxxxxxx
$ export MY_LANGUAGE=xx
$ export CONSUMER_KEY=xxxxxxxxxxxxxxxxxxx
$ export CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ export ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ export ACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$ ./tweet.sh post "Hello!"

This form will be useful to implement a bot program.

And, this script uses some external commands. You need to install them via package system on your environment: apt, yum or something. Required commands are:

  • curl
  • jq
  • nkf
  • openssl

Usage

$ ./tweet.sh [command] [...arguments]

Available commands are:

  • help: shows usage of the tweet.sh itself.
  • Reading existing tweets (require "Read" permission)
    • fetch (get, show): fetches a JSON string of a tweet.
    • search: searches tweets with queries.
    • fetch-favorites (fetch-fav): fetches favorite tweets.
    • fetch-tweets (fetch-posts): fetches tweets of a user.
  • type: detects the type of the given input.
  • body: extracts the body of a tweet.
  • owner: extracts the owner of a tweet.
  • get-list-members: gets a list's member information.
  • showme: reports the raw information of yourself.
  • whoami: reports the screen name of yourself.
  • language (lang): reports the selected language of yourself.
  • Making some changes (require "Write" permission)
    • post (tweet, tw): posts a new tweet.
    • reply: replies to an existing tweet.
    • upload: uploads an image file. (deprecated)
    • delete (del, remove, rm): deletes a tweet.
    • favorite (fav): marks a tweet as a favorite.
    • unfavorite (unfav): removes favorited flag of a tweet.
    • retweet (rt): retweets a tweet.
    • unretweet (unrt): deletes the retweet of a tweet.
    • follow: follows a user.
    • unfollow: unfollows a user.
  • Operate direct messages (require "Access direct messages" permission)
    • fetch-direct-messages (fetch-dm, get-direct-messages, get-dm): fetches recent DMs.
    • direct-message (dm): sends a DM.
    • delete-direct-message (delete-dm, del-dm): deletes a DM.
  • Misc.
    • resolve: resolves a shortened URL.
    • resolve-all: resolve all shortened URLs in the given input.

Detailed logs can be shown with the DEBUG flag, like:

$ env DEBUG=1 ./tweet.sh search -q "Bash"

This script is mainly designed to be a client library to implement Twitter bot program, instead for daily human use. For most cases this script reports response JSONs of Twitter's APIs via the standard output. See descriptions of each JSON: a tweet, an event, and other responses also.

Some commands require URL of a tweet, and they accept shortened URLs like http://t.co/***. Such URLs are automatically resolved as actual URLs like https://twitter.com/***/status/***. The detectipn pattern for such shortened URLs is defined as URL_REDIRECTORS in the script, and it must be updated for new services.

Reading existing tweets

fetch (get, show): fetches a JSON string of a tweet

  • Parameters

    • 1st argument: the ID or the URL of the tweet.
  • Standard output

  • Example

    $ ./tweet.sh fetch 0123456789
    $ ./tweet.sh fetch https://twitter.com/username/status/0123456789
    $ ./tweet.sh get 0123456789
    $ ./tweet.sh show 0123456789
    

search: searches tweets with queries.

  • Parameters

    • -q: queries. If you specify no query, then you'll see sample tweets as results.
    • -c: maximum number of tweets to be responded. 10 by default. (optional)
    • -s: the id of the last tweet already known. (optional) If you specify this option, only tweets newer than the given tweet will be returned.
    • -m: the id of the tweet you are searching tweets older than it. (optional) If you specify this option, only tweets older than the given tweet will be returned.
    • -t: type of results. (optional) Possible values: recent (default), popular, or mixed.
    • -h: command line to run for each search result. (optional) (It will receive tweets via the standard input.)
    • -w: start watching without handler. (optional)
  • Standard output

  • Example

    $ ./tweet.sh search -q "queries" -c 10
    $ ./tweet.sh search -q "Bash OR Shell Script"
    $ ./tweet.sh search -q "Bash OR Shell Script" -h 'echo "found!"; cat'
    $ ./tweet.sh search -q "Bash OR Shell Script" -w |
        while read -r tweet; do echo "found!: ${tweet}"; done
    

fetch-favorites (fetch-fav): fetches favorite tweets.

  • Parameters

    • -u: the screen name of the owner favorites to be fetched from. Yourself by default.
    • -c: maximum number of tweets to be fetched. 10 by default.
    • -s: the id of the last tweet already known. (optional) If you specify this option, only tweets newer than the given tweet will be returned.
    • -m: the id of the tweet you are searching tweets older than it. (optional) If you specify this option, only tweets older than the given tweet will be returned.
  • Standard output

  • Example

    $ ./tweet.sh fetch-favorites -c 20
    $ ./tweet.sh fetch-fav -c 10 -s 0123456789
    

fetch-tweets (fetch-posts): fetches tweets of a user.

  • Parameters

    • -u: the screen name of the owner of tweets to be fetched from. Yourself by default.
    • -c: maximum number of tweets to be fetched. 10 by default.
    • -s: the id of the last tweet already known. (optional) If you specify this option, only tweets newer than the given tweet will be returned.
    • -m: the id of the tweet you are searching tweets older than it. (optional) If you specify this option, only tweets older than the given tweet will be returned.
    • -a: include replies.
    • -r: include retweets.
    • -f: returns full text of the tweet (not truncated) sends tweet_mode=extended The json response changes the usual returned field from text to full_text.
  • Standard output

  • Example

    $ ./tweet.sh fetch-tweets -u screen_name -c 20
    $ ./tweet.sh fetch-posts -u screen_name -c 10 -s 0123456789
    

Streaming

Basically this command provides ability to get search result based on the given query.

If you want to observe new tweets matched to the query continuously, specify a callback command line as the handler via the -h option.

$ ./tweet.sh search -q "queries" -h "echo 'FOUND'; cat"

In this case, only -q and -h options are available. The script doesn't exit automatically if you specify the -h option. To stop the process, you need to send the SIGINT signal via Ctrl-C or something.

type: detects the type of the given input.

  • Parameters

  • Standard output

    • The data type detected from the input. Possible values:
      • event-follow: An event when you are followed.
      • direct-message: A direct message. It can be wrapped with a key direct_message.
      • quotation: A commented RT.
      • retweet: An RT.
      • mention: A mention or reply.
      • search-result: A tweet which is matched to the given keywords.
  • Example

    $ echo "$tweet_json" | ./tweet.sh type -k keyword1,keyword2
    

This command provides ability to detect the type of each object returned from the user stream. For unknown type input, this returns an exit status 1 and reports nothing.

body: extracts the body of a tweet.

  • Parameters

  • Standard output

    • The body string of the tweet.
  • Example

    $ ./tweet.sh body 0123456789
    $ ./tweet.sh body https://twitter.com/username/status/0123456789
    $ echo "$tweet_json" | ./tweet.sh body
    

owner: extracts the owner of a tweet.

  • Parameters

  • Standard output

    • The screen name of the owner.
  • Example

    $ ./tweet.sh owner 0123456789
    $ ./tweet.sh owner https://twitter.com/username/status/0123456789
    $ echo "$tweet_json" | ./tweet.sh owner
    

get-list-members: gets a list's member information.

  • Parameters

    • 1st argument: the ID or the URL of a list.
  • Standard output

  • Example

    $ ./tweet.sh get-list-members 0123456789
    $ ./tweet.sh get-list-members https://twitter.com/i/lists/0123456789
    

showme: reports the raw information of yourself.

This will be useful if you want to get both informations whoami and language at once.

whoami: reports the screen name of yourself.

  • Parameters

    • Nothing.
  • Standard output

    • The screen name of yourself.
  • Example

    $ ./tweet.sh whoami
    username
    

Important note: the rate limit of the API used by this command is very low. If you want to call another language command together, then you should use showme command instead.

language (lang): reports the selected language of yourself.

  • Parameters

    • Nothing.
  • Standard output

    • The language code selected by yourself.
  • Example

    $ ./tweet.sh language
    en
    $ ./tweet.sh lang
    en
    

Important note: the rate limit of the API used by this command is very low. If you want to call another whoami command together, then you should use showme command instead.

Making some changes

post (tweet, tw): posts a new tweet.

  • Parameters

    • -i: path to an image file. You can specify this multiple times. (optional)
    • -m: comma-separated list of uploaded image IDs. See also the upload command. (deprecated, left for backward compatibility)
    • -l: add location to tweet. (optional)
    • All rest arguments: the body of a new tweet to be posted. If you don't specify no extra parameters, this command reads posting body from the standard input.
  • Standard output

  • Example

    $ ./tweet.sh post A tweet from command line
    $ ./tweet.sh post 何らかのつぶやき
    $ ./tweet.sh tweet @friend Good morning.
    $ ./tweet.sh tw -i ~/photos/1.jpg -i ~/photos/2.jpg My Photos
    $ ./tweet.sh tw -i ~/photos/1.jpg -i ~/photos/2.jpg
    $ ./tweet.sh tw -m 123,456,789 My Photos (old form)
    $ ./tweet.sh post -l A tweet with location
    $ cat body.txt | ./tweet.sh post
    

All rest arguments following to the command name are posted as a tweet. If you include a user's screen name manually in the body, it will become a mention (not a reply).

reply: replies to an existing tweet.

  • Parameters

    • -i: path to an image file. You can specify this multiple times. (optional)
    • -m: comma-separated list of uploaded image IDs. See also the upload command. (deprecated, left for backward compatibility)
    • 1st rest argument: the ID or the URL of a tweet to be replied.
    • All other rest arguments: the body of a new reply to be posted. If you don't specify no extra parameters, this command reads posting body from the standard input.
  • Standard output

  • Example

    $ ./tweet.sh reply 0123456789 @friend A regular reply
    $ ./tweet.sh reply 0123456789 A silent reply
    $ ./tweet.sh reply https://twitter.com/username/status/0123456789 @friend A regular reply
    $ ./tweet.sh reply https://twitter.com/username/status/0123456789 A silent reply
    $ ./tweet.sh reply -i ~/photos/1.jpg -i ~/photos/2.jpg 0123456789 Photo reply
    $ ./tweet.sh reply -m 123,456,789 0123456789 Photo reply (old form)
    $ cat body.txt | ./tweet.sh reply 0123456789
    

Note that you have to include the user's screen name manually if it is needed. This command does not append it automatically.

upload: uploads an image file. (deprecated)

Today the post command supports uploading image files together with the posting body, thus you don't need to upload files by your hand. This command is still available for backward compatibility.

This command accepts only image files and cannot upload other type media files due to a restriction of the depending API itself. You need to use twurl or other helpers to upload non-image media files.

delete (del, remove, rm): deletes a tweet.

  • Parameters

    • 1st argument: the ID or the URL of a tweet to be deleted.
  • Standard output

  • Example

    $ ./tweet.sh delete 0123456789
    $ ./tweet.sh del https://twitter.com/username/status/0123456789
    $ ./tweet.sh remove 0123456789
    $ ./tweet.sh rm https://twitter.com/username/status/0123456789
    

favorite (fav): marks a tweet as a favorite.

  • Parameters

    • 1st argument: the ID or the URL of a tweet to be favorited.
  • Standard output

  • Example

    $ ./tweet.sh favorite 0123456789
    $ ./tweet.sh favorite https://twitter.com/username/status/0123456789
    $ ./tweet.sh fav 0123456789
    $ ./tweet.sh fav https://twitter.com/username/status/0123456789
    

unfavorite (unfav): removes favorited flag of a tweet.

  • Parameters

    • 1st argument: the ID or the URL of a tweet to be unfavorited.
  • Standard output

  • Example

    $ ./tweet.sh unfavorite 0123456789
    $ ./tweet.sh unfavorite https://twitter.com/username/status/0123456789
    $ ./tweet.sh unfav 0123456789
    $ ./tweet.sh unfav https://twitter.com/username/status/0123456789
    

retweet (rt): retweets a tweet.

  • Parameters

    • 1st argument: the ID or the URL of a tweet to be retweeted.
  • Standard output

  • Example

    $ ./tweet.sh retweet 0123456789
    $ ./tweet.sh retweet https://twitter.com/username/status/0123456789
    $ ./tweet.sh rt 0123456789
    $ ./tweet.sh rt https://twitter.com/username/status/0123456789
    

Note, you cannot add extra comment for the retweet. Instead, if you want to "quote" the tweet, then you just have to post with the URL of the original tweet.

$ ./tweet.sh post Good news! https://twitter.com/username/status/0123456789

unretweet (unrt): deletes the retweet of a tweet.

  • Parameters

    • 1st argument: the ID or the URL of a tweet to be unretweeted.
  • Standard output

  • Example

    $ ./tweet.sh unretweet 0123456789
    $ ./tweet.sh unretweet https://twitter.com/username/status/0123456789
    $ ./tweet.sh unrt 0123456789
    $ ./tweet.sh unrt https://twitter.com/username/status/0123456789
    

follow: follows a user.

  • Parameters

    • 1st argument: the screen name of a user to be followed, or a URL of a tweet.
  • Standard output

  • Example

    $ ./tweet.sh follow @username
    $ ./tweet.sh follow username
    $ ./tweet.sh follow https://twitter.com/username/status/012345
    

unfollow: unfollows a user.

  • Parameters

    • 1st argument: the screen name of a user to be unfollowed, or a URL of a tweet.
  • Standard output

  • Example

    $ ./tweet.sh unfollow @username
    $ ./tweet.sh unfollow username
    $ ./tweet.sh unfollow https://twitter.com/username/status/012345
    

#Operate direct messages

fetch-direct-messages (fetch-dm, get-direct-messages, get-dm): fetches recent DMs.

  • Parameters

    • -c: maximum number of messages to be fetched. 10 by default.
  • Standard output

  • Example

    $ ./tweet.sh fetch-direct-messages -c 20
    $ ./tweet.sh get-direct-messages -c 20
    

direct-message (dm): sends a DM.

  • Parameters

    • All arguments: the body of a new direct message to be sent. If you don't specify no parameter, this command reads message body from the standard input.
  • Standard output

  • Example

    $ ./tweet.sh direct-message @friend Good morning.
    $ ./tweet.sh direct-message friend Good morning.
    $ ./tweet.sh dm @friend Good morning.
    $ ./tweet.sh dm friend Good morning.
    $ cat body.txt | ./tweet.sh direct-message @friend
    

delete-direct-messages (delete-dm, del-dm): deletes a DM.

  • Parameters

    • The only one argument: the ID of the direct message to be deleted.
  • Standard output

  • Example

    $ ./tweet.sh delete-direct-messages 12345
    $ ./tweet.sh delete-dm 12345
    $ ./tweet.sh del-dm 12345
    

#Misc.

resolve: resolves a shortened URL.

  • Parameters

    • 1st argument: a shortened URL.
  • Standard output

    • The resolved original URL.
  • Example

    $ ./tweet.sh resolve https://t.co/xxxx
    

resolve-all: resolve all shortened URLs in the given input.

  • Parameters

    • Nothing.
  • Standard output

    • The given input with resolved URLs.
  • Example

    $ cat ./tweet-body.txt | ./tweet.sh resolve-all
    

Miscellaneous Examples

Search tweets with keywords and retweet all results

$ ./tweet.sh search -q "keyword" |
     jq -c '.statuses[]' |
     while read -r tweet; do ./tweet.sh retweet $(echo "$tweet" | jq -r .id_str); done

tweet.sh's People

Contributors

iyujagl avatar mitchellkrogza avatar mobilefieldbase avatar piroor avatar satoru-takeuchi avatar tomatrow avatar watfordjc avatar znz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tweet.sh's Issues

Images not being tweeted

First off, this is a great little application/script.

I'm having an issue with uploading images. When I run "tweet.sh upload image.png", I get a json string returned to me as if things worked but nothing is being tweeted out to the actual account. Any ideas?

Thanks

Thanks!

Just wanted to say thank you for this very useful repo. Used it to tweet updates on a web page that updates only once a month. Much appreciated!

{"errors":[{"code":32,"message":"Could not authenticate you."}]}

Hi! I'm testing the script out. When doing a simple ./tweet.sh fetch I get the error of the subject.

This is my ~/.tweet.client.key file:

MY_SCREEN_NAME=Gabrielxxxxx
MY_LANGUAGE=es_AR
CONSUMER_KEY=dwHaZxxxx
CONSUMER_SECRET=rvuXcxxxxx
ACCESS_TOKEN=11268612-ASuxxxxx
ACCESS_TOKEN_SECRET=mmQEU61xxxxx

Any tip is welcomed!

Thanks!

Could not authenticate you for some commands

I just installed it in FreeBSD and I can run

% tweet.sh fetch-favorites

succesfully, but I get:

% tweet.sh fetch
{"errors":[{"code":32,"message":"Could not authenticate you."}]}

Posting tweets also work.

Any ideas where I should look for errors? Is the authentication API different depending on the command?

Expected behaviour of watch-mentions

When I run ./tweet.sh watch -d "echo 'DM'; cat" I get results which are not related to me. They are related to people I'm connected with but these are replies and tweets which are in no way my DMs .

  1. What is the expected behaviour of the command, with or without parameters.
  2. Is the -k parameter a mandatory one?

tweet_mode=extended

Excellent command line client, thank you.

Where would I add the ability to fetch the extended tweet?

Twitter's API says to add tweet_mode=extended into the call but I'm struggling a bit to figure out where to add this in your code.

Follow shellcheck

$ wget --nv https://raw.githubusercontent.com/piroor/tweet.sh/trunk/tweet.sh
$ sudo docker run --rm -v "$(pwd):/sc" koalaman/shellcheck -f gcc /sc/tweet.sh > chk
$ awk \$0=\$NF chk | sort | uniq -c | tee >({ awk '$0=$1' ORS=+;echo 0;} | bc)
      1 [SC1090]
      2 [SC1091]
      2 [SC2001]
      1 [SC2034]
      2 [SC2048]
      2 [SC2069]
      9 [SC2086]
     68 [SC2155]
      1 [SC2162]
      7 [SC2164]
     15 [SC2166]
      1 [SC2173]
      1 [SC2181]
      8 [SC2196]
     13 [SC2213]
     10 [SC2220]
143
$ awk \$0=\$2 chk | sort | uniq -c
      1 error
     23 note
    119 warning

./tweet.sh tw -m 919166902479581184 hello : "Could not authenticate you."

mark@work:~/tweet.sh$ ./tweet.sh upload ~/Downloads/IMG_20171011_121407_small.jpg 
{"media_id":919166902479581184,"media_id_string":"919166902479581184","size":748629,"expires_after_secs":86400,"image":{"image_type":"image\/jpeg","w":4160,"h":3120}}
 mark@work:~/tweet.sh$ ./tweet.sh tw -m 919166902479581184 hello
 {"errors":[{"code":32,"message":"Could not authenticate you."}]}

:-)

Twitter API v2 ?

Seems like a great utility!
But unfortunately no longer works, since twitter now only support API v2 for the "lower tear" API access levels.

Any chance that this could be updated to work with API v2?

multi language tweet fail

i try to tweet a file with the following content

بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ
الَّذِي أَطْعَمَهُمْ مِنْ جُوعٍ وَآمَنَهُمْ مِنْ خَوْفٍ
صدق الله العظيم
download our App to get the daily Quran Reminder https://goo.gl/RgsfqD
#Quran #Quranhour #allah #islam #sunnah #muslim #religion #holyquran

but I get the error
{"errors":[{"code":32,"message":"Could not authenticate you."}]}
it tweets only English characters well and when i try in Arabic i get the error above

how to tweet with a newline

I have a txt file named "a.txt"

cat a.txt

line 1
line 2

when I do ./tweet.sh post (cat a.txt) the tweet is:

line 1 line 2

Is there anyway to tweet using newlines?
Thanks!

Tweeting uploaded media fails

./tweet.sh tw -m 1197452904204001280,1197452909031628803,1197452915402854400 My Photos!

Gives

{"errors":[{"code":32,"message":"Could not authenticate you."}]}

Nothing wrong with auth as I can do a simple tweet like

tweet.sh post Test Message Ignore

and I can of course upload the images without issues.

Putting the IDS and a Message together is failing though.

More than two key pairs?

CONSUMER_KEY=xxxxxxxxxxxxxxxxxxx
CONSUMER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ACCESS_TOKEN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Which one of these pairs are API Key and API Key Secret that Twitter just gave?

And the other, how to find?

Twitter also generated a Bearer Token.

And how to login the screen name account?

Support posting images with no caption

Using a command in the form tweet.sh tw -i image.png Hello world will successfully post the image and caption, but tweet.sh tw -i image.png causes the script to hang indefinitely for me, when I would expect it to post the image with no caption. It also hangs when sending a space, like " ".

It seems like the problem can be solved by not putting the word status in the params variable in post() if there are no more params to follow status. Images seem to work with or without captions by including the word status in posting_body():

posting_body() {
  if [ "$*" != '' ]; then
    echo -n -e "status $*" | sed -E -e 's/$/\\n/' | paste -s -d '\0' -
  fi
}

and removing the word status from post():

$(posting_body $*)

That way, the word status is not sent if there is no status/caption.
But I'm not a shell expert so I don't know if this snippet would cause other problems.

Thanks!

Deleteing DMs

Hi More of a feature request , If you are still looking at this , it would be nice to have teh option to delete DMs in the same way as deleting tweets

Ian

Great script by the way.

"curl option --form is badly used" when uploading image

Hi,

I've been playing around with your script and it seems to be the most well documented and comprehensive twitter scripts around. I have been able to successfully send text tweets, however I am struggling to get image uploads to work. My understanding from the example is that I am supposed to first upload the image, then use the media ID in the JSON response in a following tweet.

Unfortunately, when I run
./tweet.sh upload /path/to/image.jpg

Instead of JSON I get the response:
curl: option --form: is badly used here
curl: try 'curl --help' or 'curl --manual' for more information

Am I doing something wrong? Or is it possible that some change to curl has broken the script? All dependencies are the latest version.

ideas please (or ignore = close)

Hey!
Wow. Your tool looks amazing. And simple enough. Even though I don't like bash coding very much, but perhaps I could wrap it all into python functions?

ONLY if you find the time, please give this a quick read.
IF NOT, just close this issue. Then sorry to have bothered you.

I would like to automate these three tasks:

(1) follow-when-retweeted

When someone retweets one of my retweets, I would like to automatically follow them, and put them in a list, for later manual inspection (whether to mute them or even unfollow again, always needs visual inspection). Of course, it makes sense to first check whether I am already following them anyways.

(2) unfollow-wait-and-follow-again

Intention: To send them a trigger to check me out (again).

Condition on accounts:

  • I am following them, but they do not follow me back yet.
  • They are not in a (manual) blacklist of accounts that I do want want to bother with this.

Steps:

  1. Find all above accounts.
  2. one by one: Unfollow. Wait a minute or a day. Follow them again.
  3. after 3 days, check whether that was successful.

Perhaps the twitter API has a daily quota for stuff like that? Then have the script end in a way that the remaining batch can be done on the next day.

(3) retweet my own tweets

Reason: I am awake while the main group of my followers is sleeping.
Intention: Give more people a chance to see a "best of" my recent tweets.

Steps:

  1. I compile a list of (e.g. a dozen, or a hundred) of my own tweet URLs.
  2. one by one: (possibly undo the retweet, then) retweet the tweet.
  3. there should be e.g. an hour between those retweets, perhaps two retweets at at time.

Detail: I want retweets without additional comment, so no new tweet is created.

Questions:

  • Are you aware of any twitter tools which do exactly that already? That would save me time.
  • Did you have any hints for me, while reading the above?

Thanks a million! Keep up the good work!
Andreas

{"errors":[{"code":170,"message":"Missing required parameter: status."}]}

Hello,

I've some problem with tweet.sh:

root:~# pkg install ja-nkf jq
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        ja-nkf: 2.1.3,1
        jq: 1.5

Number of packages to be installed: 2

The process will require 1 MiB more space.
379 KiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching ja-nkf-2.1.3,1.txz: 100%  138 KiB  47.0kB/s    00:03
Fetching jq-1.5.txz: 100%  241 KiB  82.2kB/s    00:03
Checking integrity... done (0 conflicting)
[1/2] Installing ja-nkf-2.1.3,1...
[1/2] Extracting ja-nkf-2.1.3,1: 100%
[2/2] Installing jq-1.5...
[2/2] Extracting jq-1.5: 100%

root:~# uname -smr
FreeBSD 9.3-STABLE i386

root:~# curl -V
curl 7.52.1 (i386-portbld-freebsd9.3) libcurl/7.52.1 OpenSSL/0.9.8zh zlib/1.2.8 nghttp2/1.18.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy

budsz:~$ ./tweet.sh whoami
my_screen_namebudsz:~$ 	(Success)

budsz:~$ ./tweet.sh post test (Failed)
{"errors":[{"code":170,"message":"Missing required parameter: status."}]}

Any suggestion for this error?

Thank You

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.