Archive for the ‘experiments’ Category

TwitPic upload hack

Tuesday, January 13th, 2009

Some Twitter users have been using TwitPic to link photos to tweets. I, on the other hand, have been using Flickr and Snipr. It’s a PITA, so I’m giving TwitPic a whirl. Sadly, Digsby, does not support TwitPic, and I’m not installing yet another app.

TwitPic has an API, so I rolled my own simple uploader with cygwin and curl. There’s no doubt in my mind that I’ve reinvented the wheel here…

Standard disclaimer applies: this is quick n’ dirty(tm):

#!/bin/bash

# curl executable.  I'm a PC.
CURL=C:/cygwin/bin/curl

# The upload script that will accept the data
UPLOAD_URL=http://twitpic.com/api/uploadAndPost

# Snag stuff off the command line
TWITTER_USER=$1
TWITTER_PW=$2
PHOTO=`cygpath -m "$3"`
TWEET_MSG=$4

# Prompt for message if it's not given
if [ "$TWEET_MSG" = "" ]; then
   read -p "Tweet msg: " TWEET_MSG
fi

# Go
echo Uploading...
$CURL \
  --form username=$TWITTER_USER \
  --form password=$TWITTER_PW \
  --form media=@"$PHOTO" \
  --form message="$TWEET_MSG" $UPLOAD_URL

# Wait for user to read result message
echo
read -p "Press <enter> to continue" bogus

Create a desktop shortcut with uid and password:

C:\cygwin\bin\sh.exe ~/twitpic.sh --userid-- --password--

Now just drag and drop the photo onto the desktop shortcut.

Some things you do just because you can

Friday, October 24th, 2008

Need another Sonos controller?

Hack together openlink, perl, sonosweb and iphone sonos:

I had to go through Perl dependency hell (Perl really is an abomination) to get sonosweb working on the linkstation, but it works pretty well now.

Throw in a little DD-WRT and ssh and you can really mess with your S.O. by changing the music at home from the office.

Now I need to write up how I got through the seven circles of dependency hell before I forget. It took more than a quarter to Charon.

Random text post

Friday, April 20th, 2007

Here’s some random text for The Google to index:

I thought, “sldfkjdlkjd wwerrrjrjs ttlljjjgllkkttj sldfe sdfw?” But naturally, fjwjejrb jboegj and wllejrbbbjelti3! So instead I wnne85gnns dlfkjwrng yot!

Shortly thereafter, wnern6xioa hgqqp38ng alasjtq8p6 sgklgfnqp lanffsan ouq dlfn sda gqpq dnfgga. But still, there is the matter of akl e7a z fngfn lqn fqi ore.

“IuthlzJKSf hnaa jasdj tjla5!” I said. “A hafaljsda nfqo ietyalf hld sh q5a.”

No, that will never work. Aj awfahqeol q89 ahlfqp3984 bdfalkf.

Wijit Gadget

Tuesday, April 10th, 2007

Or is that gadget wijit? Anyway, there’s an official one now, so I turned off the old, experimental one.

Get the new one here: add to google

A TiVo post

Wednesday, April 4th, 2007

This is a post about TiVo. “TiVo” is a favorite search term at Lijit, so I’m writing a post about it so TiVo will come up in my search results.

You can see what’s currently recorded on my TiVo in the sidebar on the right.

tivo logo