Yep, continuing the yesterday’s post about how to tweet via terminal, now, I’ll give you another example to tweet via terminal. It’s still using curl, but, now we’ll tweet by calling a file with bash command inside. It (still)looks cool, and you don’t have to type a looong command in terminal just to tweet (in a case you don’t like to memorize the looong command)😆 Use this script:
#!/bin/bash read -p "Username: " username stty -echo read -p "Password: " password;echo stty echo read -p "Status: " status curl -u $username:$password -d status="$status" http://twitter.com/statuses/update.xml 1> /dev/null echo "Status updated! ;)"
Save and name it whatever-you-wish-to-name-it continued with sh extension, so it will be like “i-wish-to-name-it-like-this.sh”. After that, give this file ability to be run, with command “chmod +x i-wish-to-name-it-like-this.sh”. Then just try run “./i-wish-to-name-it-like-this.sh”.
It should look like this, when you’re try to run it: