Update Status Twitter via Shell Script

Posted on 9 February 2010 by

Twitter Status UpdateUntuk mengupdate status twitter lewat shell script sebenarnya kita hanya menggunakan HTTP request. Perintah yang digunakan adalah POST(bukan metode HTTP) atau nama lainnya lwp-request sebuah perl script yang hampir semua distribusi pasti ada. OK langusng aja kita praktikan bagaimana caranya.

Langkah-langkah

  1. Buka text editor favorite kamu.
  2. Copy dan paste code dibawah ini.
    #!/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/ / /g"` # space => 
    TSTATUS=`echo $TSTATUS | sed "s/@/@/g"` # @ => @
    TSTATUS=`echo $TSTATUS | sed "s/\////g"` # / => /
    TSTATUS=`echo $TSTATUS | sed "s/:/:/g"` # : => ;
    TSTATUS=`echo $TSTATUS | sed "s/#/#/g"` # # => #
    
    # now POST the data
    echo ""
    echo -n "Updating status..."
    echo "${TDATA}${TSTATUS}" | POST -C casino  $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
    
  3. Ganti TUNAME dengan username kamu sendiri.
  4. Simpan ke satu directory misal /tmp (karena hanya tes).
  5. Beri nama twitter.sh
  6. Buka terminal System » Application » Terminal
  7. Masuk ke /tmp direktori dan berikan permission execute pada file tersebut.
  8. $ cd /tmp
    $ chmod x twitter.sh
  9. Eksekusi file tersebut, kamu akan ditanya password dan status kamu.
    $ ./twitter.sh
  10. Setelah itu maka status twitter kamu telah terupdate :).
    Twitter Status

Download the Code

twitter.sh.zip via ziddu.com.
Size: 0.69kb
MD5 Checksum: f9d38c632430a617331cc4f8d298fcf1

Video

Untuk melihat video screencast dari tutorial ini klik http://lug.stikom.edu/2010/02/screencast-update-twitter-status-via-shell-script/

Sumber:
http://www.less-talk-more-example.info/2010/02/update-twitter-status-via-shell-script.html

Related Post

49 Comments

bester blog plastischer chirurgie

8 August 2015

Elizabeth Ruby is passionate about good health and using healthy products on her skin.
Harris isn’t the only TV personality who has gotten plastic surgery after feeling pressured to
change her looks. Between the two incisions, the tissue of the lower back is then mobilized as flaps for
enhancement of the upper buttock region.


descarga

21 October 2014

He leído tus artículos dos veces queriendo hallar algo diferente y
la realidad es que de esta manera pasa. Cada que leo tus artículos encuentro
algo nuevo. Te juro que llevo no menos de tres horas leyendo cada una de las cosas que has escrito y me semejan geniales.

Espero que no creas que intento acosarte jeje.
Esta vez en serio, quiero decirte que es una grata experiencia poder encontrarme con gente que tiene grandes habilidades con las letras.
Espero que sigas de esta manera y que si se da el momento, podamos conocernos.
Saludos!


h10 voucher codes

19 October 2014

Fantastic beat ! I ish to apprentice while you amend your site, how can i subscribe for a blog
web site? The account helped me a acceptable deal. I had
been tiny bit acquainted of this your broadcast offered bright clear concept


yankodesign.com

14 October 2014

Fantastic beat ! I wish to apprentice while you amend your web site, how can i subscribe for a blog web site?
The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast
provided bright clear concept


Post a Comment

Your email is never shared.