ZenTwitter 1.0

ZenTwitter is a small script to update your Twitter account without the need of having a browser window open all the time.
ZenTwitter is a small script to update your Twitter account without the need of having a browser window open all the time. It uses zenity and curl.

Requirements:

· zenity
· curl

Installation:

Just dump it into your ~/bin directory, open it in the editor of your choice to change the username/password, make it executable (chmod a+x) and add a launcher icon to the panel/menu/desktop of your preferred window manager.

Source

~/bin/ZenTwitter.sh

#!/bin/bash
# @author Michael Klier
# @www http://www.chimeric.de/pojects/ZenTwitter

# trivial twitter status update client

# set username/password
USER="username"
PASS="password"

# main script
URL="https://twitter.com/statuses/update.xml"
ZENITY=/usr/bin/zenity
CURL=/usr/bin/curl

# check if zenity is installed
if [[ ! -x $ZENITY ]];
then
echo "ERROR: Zenity is missing!"
exit 1
fi

# check if curl is installed
if [[ ! -x $CURL ]];
then
$ZENITY --error --text="ERROR: curl is missing" --title="ZenTwitter"
exit 1
fi

# get tweet
tweet=$(${ZENITY}|> --entry --text="Gimme your tweet:" --title="ZenTwitter")

if [[ "$?" == 1 ]];
then
exit 0
fi

while [[ $(echo "${tweet}" | tr -d ' ') == "" ]];
do
tweet=$(${ZENITY}|> --entry --text="D'oh! You entered nothing! Try again or cancel:" --title="ZenTwitter")
if [[ "$?" == 1 ]];
then
exit 0
fi
done

# update status
$CURL -u ${USER}|>:${PASS}|> -d status="${tweet}" ${URL}|> -k

if [[ "$?" == 0 ]];
then
$ZENITY --info --text="Updated successful!" --title="ZenTwitter"
exit 0
else
$ZENITY --error --text="Something went wrong!nRun ZenTwitter.sh from a commandline for more information!" --title="ZenTwitter"
exit 1
fi

last updated on:
April 2nd, 2008, 15:06 GMT
price:
FREE!
developed by:
Michael Klier
homepage:
www.chimeric.de
license type:
GPL (GNU General Public License) 
category:
ROOT \ Communications \ Chat

FREE!

In a hurry? Add it to your Download Basket!

user rating 14

3.3/5
 

0/5

1 Screenshot
ZenTwitter

Add your review!

SUBMIT