About Blog Gallery Twit

All articles, tagged with “xchat”

Twitter shell script with curl

I really wanted to create a plugin for Twitter and XChat2, but I decided to get lazy. Only caveat for using this is that you have to escape your own text.

Bash Script, I named it twit, made it executable and placed it in my PATH.

#!/bin/bash
nohup curl -s -u YOURUSER:YOURPASS --data status="`echo $@`" http://twitter.com/statuses/update.xml > /dev/null 2>&1 &

Now this doesn’t return anything to the console, and it nohups it so you don’t have to wait for it to do its stuff.

wstearns@ubuntu:~$ twit Ok, now that I have bash working. I am happy. :-\)

Notice how I had to escape the ). So, all there is to do in XChat is add a Settings->Advanced->User Commands. Now just add a command, I did mine with a name of TWIT and a command of exec twit &2. To try it out now you just do a /twit Hmmm...let me see if my wrapper works in xchat now..

So there we go, I have my cheap interface on my Ubuntu box in both apps that I use the most for the price of one.