Tweeting in Linux
Quickly tweet from your Linux environment with this script - all you need is the ability to launch a shell script, e.g. from a terminal, shortcut on your desktop or Gnome panel
Requires: curl, zenity.
Change the TWITTER_USERNAME and TWITTER_PASSWORD accordingly. Remember to make the script executable and since it contains your twitter username and password you most probably want u+rwx, go-rwx (or 0700).
#!/bin/bash TWITTER_USERNAME=twitterusernamehere TWITTER_PASSWORD=twitterpasswordhere tweet=$( zenity --title "Tweet:" --entry ) if [ ! -z "$tweet" ]; then result=$( curl -s -u $TWITTER_USERNAME:$TWITTER_PASSWORD -d status="$tweet" http://twitter.com/statuses/update.xml | grep -i "could not authenticate" | wc -l ) if [[ $result -eq "1" ]]; then zenity --error --text="Error logging onto Twitter - please check your username and password or Twitter availability." else zenity --info --text="Tweeted!" fi fi
2 Comments
Other Links to this Post
RSS feed for comments on this post. TrackBack URI
By Guru, June 9, 2008 @ 12:07 am
Inspired by http://morethanseven.net/posts/posting-to-twitter-using-php/
By Anonymous, July 4, 2008 @ 12:22 pm
Hello. There is a small and easy-to-use PHP library for sending messages to Twitter and receiving status updates - http://phpfashion.com/twitter-for-php