TWiki> Cenkes Web>Twiget (18 Apr 2009, Main.AndrewPantyukhin)EditAttach
Tags:
create new tag
, view all tags

Twiget

A command-line Twitter client based on wget.

Code

It's actually a one-line script:
#!/bin/sh
wget -q -O ~/twget.tmp \
--header='X-Twitter-Client: Twiget' \
--header='X-Twitter-Client-URL: http://wiki.cenkes.org/Cenkes/Twiget' \
--header='X-Twitter-Client-Version: 0.0.1' \
--auth-no-challenge \
--http-user=infofarmer \
--post-data=status="$*" \
https://twitter.com/statuses/update.json

Installation

  1. put the code into ~/bin/twiget.sh
  2. run chmod 755 ~/bin/twiget.sh
  3. run sed -e s/infofarmer/your-username/ ~/bin/twiget.sh
  4. add hostname twitter.com login your-username password your-password to ~/.netrc
  5. that's it

Operation

Just run it with your status as an argument. No need to quote, unless there are shell meta-characters in it:
twiget.sh Test123 有難う!
Topic revision: r1 - 18 Apr 2009 - 06:12:22 - Main.AndrewPantyukhin
 

Cenkes - IT Pro Bono