Tweeting แบบดิบๆ ผ่าน Linux Command Line
mrgill | December 30, 2009 | 524 Views
เมื่อกี้เข้า linuxtoday.com ไปเจอทิปเด็ดๆ ใน junauza.com เรื่อง Follow Me: Tweeting from the Linux Command Line อ่านแล้วน่าสนใจดี และหลังจากลองแล้วก็ได้ผลครับเลยนำมาบอกต่อ
ขั้นตอนเขามีอยู่ว่า
1. ติดตั้ง curl
mrgill@mrgill-laptop:~$ sudo apt-get install curl
2. สร้างไฟล์ชื่อ twitter ไว้ใน /usr/bin/ ด้วย text editor ที่ชอบในตัวอย่างเขาใช้ gedit แต่ผมชอบ nano
mrgill@mrgill-laptop:~$ sudo nano /usr/bin/twitter
จากนั้นนำโค้ดด้านล่างไปวาง
curl --basic --user "yourusername:yourpasswd" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null; echo Message Sent!
*อย่าลืมเปลี่ยน yourusername กับ yourpasswd เป็นของ twitter ของคุณ (กด Ctrl + O เพื่อบันทึก และกด Ctrl + X เพื่อออก)
3. กำหนดสิทธิ์ให้ /usr/bin/twitter สามารถรันได้
mrgill@mrgill-laptop:~$ sudo chmod +x /usr/bin/twitter
4. ทดลอง tweeting กันเลย โดยพิมพ์ twitter เว้นวรรค ข้อความของคุณ
mrgill@mrgill-laptop:~$ twitter test tweet from command lind
ภาพตัวอย่างคำสั่ง twitter
tweet บน twitter.com
5. ขอให้สนุกกับการ tweet
แหล่งข้อมูล : http://www.junauza.com/2009/03/follow-me-twitting-from-linux-command.html
Category : Internet,Linux,Programming,Ubuntu




1 Comment Leave a Comment
1. MeaNaRiN Blogger » &hellip | May 8, 2010 at 2:10 PM
[...] ๆ จาก mr.gill ครับผม GD Star Ratingloading…GD Star Ratingloading… May 8th, 2010 in Diary | tags: [...]
Leave a Comment
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
TrackBack URL | RSS feed for comments on this post.