📜 ⬆️ ⬇️

Tweet from command line

In the meantime, he wrote a small hand-made article for posting messages on twitter from the command line, who can come in handy:

twit file (put, for example, in / usr / local / sbin /):
#! / bin / sh

# Imports $ TPASS, $ TUSER
. ~ / .twit / pass

curl --basic --user $ TUSER: $ TPASS --data status = "$ 1" twitter.com/statuses/update.xml > / dev / null 2> / dev / null
')
if [$? -eq "0"]; then
echo "ok";
else
echo "not ok";
fi

And we throw the pass file into ~ / .twit / (do not forget to give permissions 400):
TUSER = YourTwitterUser
TPASS = YourTwitterPassword


And we use:
$ twit "Trifle, but nice"

Source: https://habr.com/ru/post/27433/


All Articles