Tutorial: Updating Twitter Status via Shell Script
The Goal
Updating twitter status via shell script. The command used to send the HTTP request is POST a.k.a lwp-request (a perl script) that included in most linux distribution.
The Process
- Open your text editor i.e. gedit/geany/etc or even vi you are die hard fans of this editor.
- Copy and paste code below.
#!/bin/bash # TUNAME="lesstalkme" TUPASS="" TSTATUS="" TURL="http://twitter.com/statuses/update.xml" TDATA="source=LTME&status=" # print some fancy header :) echo "-----------------------------------------" echo " Twitter Status Updater" echo " http://www.less-talk-more-example.info/" echo "------------------------------------------" echo -n "Twitter Password: " read -ers TUPASS echo -e "\nEnter Twitter Status:" read TSTATUS # replace some characters ( I'm too lazy to replace all the characters :)) TSTATUS=`echo $TSTATUS | sed 's/ /%20/g'` # space => %20 TSTATUS=`echo $TSTATUS | sed 's/@/%40/g'` # @ => %40 TSTATUS=`echo $TSTATUS | sed 's/\//%2F/g'` # / => %2F TSTATUS=`echo $TSTATUS | sed 's/:/%3A/g'` # : => %3B TSTATUS=`echo $TSTATUS | sed 's/#/%23/g'` # # => %23 # now POST the data echo "" echo -n "Updating status..." echo "${TDATA}${TSTATUS}" | POST -C $TUNAME:$TUPASS $TURL | grep $TUNAME > /dev/null # check status # ------------ # successfull request always return XML format that containts our username # so we grep that to check the status if [ $? -eq 0 ]; then echo "DONE." else echo "ERROR." fi
- Replace TUNAME value with your own username.
- Save to somewhere i.e. /tmp directory just for testing.
- Name it twitter.sh
- Open the shell terminal in GNOME System » Application » Terminal
- Go to /tmp directory and give execute permission to the file.
$ cd /tmp $ chmod +x twitter.sh
- Execute the file, you’ll be promted to enter twitter password and status.
$ ./twitter.sh
- Fill it and voila!! your twitter status has been updated :).
Screencast
Download the Code
twitter.sh.zip via ziddu.com.
Size: 0.69kb
MD5 Checksum: f9d38c632430a617331cc4f8d298fcf1
Source:
http://www.less-talk-more-example.info/2010/02/update-twitter-status-via-shell-script.html








Bagi anda yang menggunakan wordpress sebagai engine blog, info berikut ini mungkin sangat berguna untuk anda. Wordpress sebelum versi 2.8.4 memiliki bug Reset Admin Password. Pada versi-versi tersebut seserang tanpa akses privilege apapun dapat dengan mudah mereset password account anda anda hanya dengan mensupply sebuah array pada parameterkey yang ada di query string URL. 
Pernahkah ada keinginan dari anda untuk mengganti hostname dari sistem anda. Biasanya ketika kita menginstall misal distro ubuntu hostname kita akan menjadi username-laptop dsb. Nah bagaimana kita mengubahnya? Caranya sebenarnya cukup simple. Buka terminal anda klik Application » Accessories » Terminal
Wah… udah lama g ngepost nih, saatnya meramaikan kembali blantikan situs lug.stikom.edu :D. OK, langsung saja. Mencari nama file adalah hal yang biasa dan sudah sering dilakukan bahkan end-userpun sering melakukannya. Tetapi, bagi sebagian dari kita terutama application developer yang kegemarannya ngoprek source code. Bayangkan situasi seperti ini:








