Twittering from the command line

Twitter users often have trouble explaining just exactly what the service is for. The site specifically asks “What are you doing right now?” A simple interface and multiple ways to update means people have started hooking it to different real world objects… objects that aren’t reporting what they had for lunch. After the break, we’ll cover a couple devices that have interfaced Twitter to the real world and how you can update from your command line.


Justin Wickett was looking for a way to control his room lights via his cellphone. By using Bob Paauwe’s iLink INSTEON software and Twitter, he was able to control basic functions. Now he can SMS text like “bedroom lights off” and the software does his bidding. Of course, in the time it takes to send and process this request you could just as easily walk over and shut of the lights. We’re sure he’s planning more features than just that.

Adafruit Industries is selling an interesting device called the Botanicalls Twitter kit. It will post directly to Twitter when your plant is in need of water. Using a moisture sensor and built in Ethernet port it just requires some basic soldering to get started.


Pictured above is Ninja Networks’ Shoutwall from Defcon (photo: pinguino). It receives and displays direct SMS messages and Twitter updates. It also does reverse number lookups on Dodgeball to get user icons. An Ericsson T39m with a data cable is used because it provides an easy SMS interface. Take it to a party and your service provider is sure to wonder how you managed to receive 4000 inbound txt messages in one weekend.

curl --basic --user "$user:$pass" --data-ascii
"status=testing123" http://twitter.com/statuses/update.json

If you want to strap twitter to your own project, it’s probably best to learn how to update from the command line. Dave Thomas with Linux Journal posted how to do it using cURL. It’s definitely an easy way to get your feet wet with the Twitter API.

Comments

  1. Volt says:

    I actually came across a command line Twitter client written in Perl just a couple days ago:
    http://www.floodgap.com/software/ttytter/

    It uses curl or lynx to communicate with the servers.

  2. wackyvorlon says:

    I have my server twittering it’s uptime nightly at midnight. You can view the output here:
    http://www.twitter.com/vogonuptime

    As you can see, we’re starting to approach 100 days of uptime.

  3. Malcolm Dugdale says:

    For controlling lights, and getting the information ‘twittered’, I use the Minerva home automation suite.

    Also, an even more pointless use of twitter is http://blog.unixdaemon.net/cgi-bin/blosxom.pl/geekstuff/twitter_and_bash_bad_ideas.html

  4. Skyler Orlando says:

    The nice thing about turning lights on and off with a cell phone is if you’re in the airport, your flight is leaving in 5 minutes, and you suddenly realize you left your light on in your room, you can just tell them to turn off. Personally, I’d probably prefer using a pbx so I could call it, but that’s just me; SMS works where calling doesn’t.

  5. fartface says:

    Crestron lighting system with a CEN-TIA kicks the crap out of all this stuff. and yes I can also have my crestron gear recieve a SMS. I do have a GSM interface.

    Been there done that, mine is reliable and controls the whole house, tv’s stereos, theater, sprinklers, etc…. Oh and it’s 10 years old.

    If I wanted to I could do the silly twitter watching, but I think it’s silly.

  6. Chris Elsmore says:

    A nice twitter client and general into to the twitter API in Python and Open Source is Twyt, by Andy Price available at http://andrewprice.me.uk/projects/twyt/

  7. ryan says:

    Lifehacker had some articles about this – one was about using Launchy and curl with batches to update things through twitter – which is nice because you can use twitter as a go between for updating your gcal or etc.

    http://lifehacker.com/software/hack-attack/take-launchy-beyond-application-launching-284127.php
    http://lifehacker.com/365123/send-twitters-from-the-command-line-in-any-os

  8. Insteon says:

    The latency on using your provider’s network to SMS home automation commands would kill the usefulness – I barely like waiting for my iphone to connect to wifi when it wakes up so I can use my smartlinc to shutoff lights…

  9. Dan Marlow says:

    Not bad, but for those of us still stuck on Windows it might be easier to plug in this free Twitter command line tool:

    http://twittercommandline.wordpress.com/

    No cURL necessary. Also supports some other service called Snipia, (http://www.snipia.com/) which is a corporate twitter for business.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,613 other followers