Tweeting แบบดิบๆ ผ่าน Linux Command Line
เมื่อกี้เข้า 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 สามารถรันได้
(more…)
1 Comment December 30, 2009

