Twitter

From Indie IT Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

How To Tweet Via The Command Line

sudo apt-get install ruby1.9.1-examples ri1.9.1 graphviz ruby1.9.1-dev
sudo gem install t
sudo mv /usr/local/bin/t /usr/local/bin/tweet
tweet authorize
tweet accounts
tweet help
tweet update "This is a test from my Linux computer via the command line."

Thanks - http://sferik.github.io/t/

How To Save A Twitter Feed With Command Line Tool

Download and install RSS Tool for Linux.

Single Manual Use

/usr/local/bin/rsstool https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=twitter_username

Multiple Automated Use

Edit your crontab.

crontab -e

Add the following line, which runs just before midnight, strips out the rubbish and saves the text format version into a text file.

59 23 * * * DATE=$( date +%F ) && /usr/local/bin/rsstool --since="$DATE" --shtml --sdesc --slf --txt https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=twitter_username >> ~/Documents/twitter_username.txt