DISQUS

DISQUS Hello! Christopher S. Penn's Awaken Your Superhero is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Christopher S. Penn's Awaken Your Superhero

Christopher S. Penn's Awaken Your Superhero
Jump to original thread »
Author

How to Twitter from Terminal on the Mac

Started by Christopher S. Penn · 10 months ago

The Mac’s Terminal is the UNIX command line. It’s hard core, the stuff that Apple actually tries to keep away from the casual user. It’s the direct line to the heart of the machine, and it’s where cool scripting action can occur. Here’s ... Continue reading »

11 comments

  • Anyone know if this or something similar works in windows?
  • That's for outbound, right? Is there a way to "tail the log" and watch realtime status come IN?
  • Thanks! I added the silent option and sent the stdout text to heck:

    #!/usr/bin/env sh
    curl -u yourusername -d status="$1" -s -o /dev/null http://twitter.com/statuses/update.xml
  • Hi,
    I work with ubuntu 7.10
    I've follow the steps but when I type in the terminal:
    tw
    and ask for my host password I enter my twitter pass, but it says:
    Couldn't resolve host
    The host pass and the twitter pass are different?
    Thanks
  • Now, works fine. I don't know what's happened.
    Only to add the script works in gnu/linux OS too
    Regards
  • Does this not work with the curl that ships with Leopard? I left my password out of the command, was prompted for it, but my post didn't appear. I saw the html go by.

    Cool. I'll be looking into Chris Brogan's question. I'm definitely interested in seeing Tweets in the Terminal.
  • Dunno - as a rule, I typically compile major packages I know I'm going to use from source. That's a me oddity :)
  • to improve that, and use without commas i make it


    crimeboy@groselia:~$ cat twi
    #!/bin/bash
    # requires curl
    ###########################

    ######## CONFIG
    USER=YOULOGIN
    PASS=YOURPASS
    URL="http://twitter.com/statuses/update.xml"
    ###############
    curl -u $USER:$PASS -d status="$*" -s -o /dev/null ${URL}
  • Hello,

    I like you script, its simple and sweet. I only have to say that its probably not a good idea to advise people to chmod something to 777. This would enable other users (who would have access to your machine or network) to see not only the password which is hard coded in the script, but to change the script and insert something malicious. Perhaps something a bit more conservative like 700 would be a better choice. This value would mean that the owner (you) has read, write and execute permissions on the file, but no one else. I know you probably, and rightfully trust the people on your network, but hey--its the same amount of typing and you get free security :).

    Kind Regards,

    Jesse
  • This looks great. I don't know anything about compiling commands so I tried the curl that comes with OS X. When I try this only the content up to my first space is posted on Twitter. Do you think that's my curl or is there something else you think it might be?
  • Huh, my quotes looked funny around the $1 - I created the text file using the cat command. Fixed the quotes with pico, they look right now, and it works. Thanks.

Add New Comment

Returning? Login