Username Password

Lost Password
View Thread
Explore Your Brain » Operating System » Open Source OS
update status twitter via TERMINAL
Username
Password
Register FAQ Members List Today's Posts Search

Print Thread

17-02-2010 10:01 AM update status twitter via TERMINAL | Edited by ayam-kalkun 25-02-2010 08:13 PM
User Avatar

ayam-kalkun
Anbu


Posts: 380
Joined: 20.05.09
Location: /etc/ExploreYourBrain
Age: 31
Untuk 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 lets cek it out.

i818.photobucket.com/albums/zz107/iqbalsipenguinkecil/TU-1.jpg

Download source  Code

#!/bin/bash
#
TUNAME="User name kamu"
TUPASS="Password kamu"
TSTATUS=""
TURL="http://twitter.com/statuses/update.xml"
TDATA="source=LTME&status="
 
# print some fancy header :)
echo "-----------------------------------------"
echo "         Twitter Status Updater"
echo " http://www.exploreyourbrain.com/"
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





Ganti TUNAME dan TUPASS dengan username dan password kamu sendiri.

Simpan ke satu directory misal /home.

Beri nama tu.sh (atou terserah yang penting exkensinya .sh harus .sh okey..)

Buka terminal System » Application » Terminal atau alt+f2 » x-terminal-emulator

Masuk ke /home direktori dan berikan permission execute pada file tersebut.
[/code]
$ cd /home
$ chmod +x tu.sh

Eksekusi file tersebut, kamu akan ditanya password dan status kamu.
Download source  Code

$ ./tu.sh





i818.photobucket.com/albums/zz107/iqbalsipenguinkecil/TU-1.jpg

i818.photobucket.com/albums/zz107/iqbalsipenguinkecil/TU2.png


Setelah itu maka status twitter kamu telah terupdate :).

i818.photobucket.com/albums/zz107/iqbalsipenguinkecil/TU1.png

click gambar untuk memperbesar..
Barangsiapa mengajarkan ilmu, maka baginya pahala seperti orang yang mengamalkan ilmu nya dan tidak akan mengurangi pahala orang yang melakukan amal tersebut.
 
Offline
Jump to Forum:
Forum powered by fusionBoard
Share this Thread
URL:
BBcode:
HTML:
Similar Threads
Thread Forum Replies Last Post
Update Smiley PHP-Fusion Explore CMS PHP-Fusion 5 01-04-2011 16:34
Browsing VIA Terminal Open Source OS 8 22-10-2010 20:02
[IDM @ XYB] Internet Download Manager Update Software 12 15-03-2010 12:36
Update TCP-Z Software 5 04-03-2010 00:10
KCNcrew 1/10/09 (Update) Mac & Apple Family 2 18-10-2009 12:07
Copyright © 2007-2016