Archive - Mar 19, 2008

Paul W. Campbell posted a photo:

 The Factory that Never Was

Built ten years ago but never put into use due to a crash in the semiconductor market. Soon to be demolished.

Paul W. Campbell posted a photo:

Day 038


Scimon linked to this article.

There is an Updated version

I've added some checks and split the username and password into a separate, secure, file.

/usr/local/bin/cl-twit


#!/bin/bash
# Source http://www.fsckin.com/2008/03/19/twittering-from-the-command-line/
# 0.0.1 - initial adaptation
# 0.0.2 - protect against errors when using: cl-twit "This isn't going to cause an error."
#        The double quotes are needed because of the ' which introduces spaces into $1
if [ -z "$1" ]; then
    echo You have to say SOMETHING!
    exit
fi
TWITFILE=~/.twitter
TWITFILESECURE=unknown
if ( stat $TWITFILE | grep '^Access: (..00/' > /dev/null ) ; then
    TWITFILESECURE=yes
fi
if [ $TWITFILESECURE != "yes" ]; then
    echo The file $TWITFILE should not be world readable
    echo Try: chmod go-rwx $TWITFILE
    exit
fi
. $TWITFILE
if [ -z $TWITUSER ]; then
    echo TWITUSER not set in $TWITFILE
    exit
fi
if [ -z $TWITPASS ]; then
    echo TWITPASS not set in $TWITFILE
    exit
fi
curl --basic --user "$TWITUSER:$TWITPASS" \
    --data-ascii "status=`echo $@|tr ' ' '+'`" \
    "http://twitter.com/statuses/update.json"

You will need to create a file ~/.twitter like the following:


TWITUSER=kemitix
TWITPASS=my-password

Make sure only you can read it:

chmod go-rwx ~/.twitter

This makes it nice and safe to install on a multi-user machine. Assuming you trust root.


The world mourns the loss of one of its greatest and most gentle humans with the death of Arthur C. Clarke. He passed away late last night in his home in Sri Lanka at the ripe old age of 90.

If I had to point to any person or persons in my nearly 60 years of living on planet Earth that influenced me the most (outside of my parents) I would have to narrow it down to just two men, humanist and philosopher Joseph Campbell and the renowned, author, scientist, futurist and humanitarian Sir Arthur C. Clarke.

Read the rest of Sam Sloane's dedication on Slice Of SciFi.

Project navigation

Archives

January 2009
MonTueWedThuFriSatSun
-2-101234
567891011
12131415161718
19202122232425
2627282930311

My Podiobooks

Syndicate

Syndicate content