Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Sunday, May 22, 2011

Android: Twidroyd vs. TweetCaster Pro: Twitter Clients

Recently someone asked me about my choice of Twitter client on Android:  why had I chosen the Twidroyd app over the official client from Twitter?  At the time I had also just downloaded, and was trying out the TweetCaster Pro app.

Social apps
I have been meaning to do a series of posts about various categories of Android apps.  Hopefully this will be the first such post.  My goal is to be helpful to others who are curious about what apps are out there, but aren't as adventurous as I am in trying them all.  Come on in, by the way, the water's fine.

The first thing that attracted me to the Twidroyd app was the Posterous Twitter help page, which basically says that if you want to use a Twitter app on Android that integrates Posterous, Twidroyd is your only option.

I have been using Posterous to post pictures, video, and occasionally long-form text from my phone since before I had a smartphone, and I'm still very happy with it.  As such, Posterous integration was a good selling point for an Android Twitter app.

I also at the time downloaded the official Twitter app, as well as TweetDeck, but I didn't find either of them to be particularly compelling.

Twidroyd
I should mention that, while Twidroyd is the only Twitter app that integrates Posterous, there is also an official Posterous app, which generates posts that can be auto-posted to Twitter.  This is the way that I end up sending most of my Posterous posts.  The only advantage of using Twidroyd is if I wanted to create a Posterous post, but post it to Twitter with text that is different from just the title of the post.

Another Twidroyd feature that I like is its Bit.ly integration.  Twidroyd allows you to enter your Bit.ly account's API key, and the shortened links will be "yours" and show up on your personal Bit.ly history, where you can track and manage them with the rest of your Bit.ly shortened URLs. What Twidroyd seems to do best is integrate itself well with other online services.  Here's a list:
  • Photos: Lockerz, Twitpic, Twitgoo, YFrog, Posterous
  • Video: Lockerz, Vidly.com, Posterous, Twitvid.com
  • URL Shortening: TinyURL, is.gd, Bit.ly, Goo.gl
  • Tweet Shortening: Tmi, Twitlonger

It also works with multiple Twitter accounts, though I only have one.

Twidroyd lets you customize its notifications in just about every possible way.  One nice feature that other clients don't have is that it displays the tweet text in the notification bar.  This is something that I'm finding I miss when trying out other clients.

Speaking of other clients, Amazon recently gave away the Premium version of TweetCaster as their free app of the day, so I downloaded it and gave it a try.

TweetCast
The first thing that struck me was that it was very visually appealing. And not only does it look good, the interface is very functional!  Tweets by me, replies, and mentions, are all highlighted in different color gradient backgrounds.  Favorites and retweets are marked with intuitive icons.  Tweets by me have the icon on the opposite side, and for retweets, the retweeter's icon is superimposed on the bottom corner of the original author's icon.  Looking at the settings, all of these things are customizable as well.

TweetCaster also integrates with Bit.ly, but it doesn't use the API key.  It supports the following 3rd party services:
  • Photos: lockerz.com, twitpic.com, yfrog.com
  • Video: twitvid.com
  • URL Shortening: bit.ly, is.gd
The jury is still out on whether I'm going to switch to TweetCaster.  The way the interface graphically communicates so much information is appealing.  I can post photos and video directly to Posterous, and I have yet to post a Bit.ly-shortened URL link from my phone.  If I have more than 140 characters to post, I can just use Posterous instead of Twidroyd's integrated text shortening features.

What it comes down to for me is Twidroyd's notification previews vs. TweetCaster's pretty and functional interface.  For now I'm using both.

Wednesday, December 08, 2010

Twitpic-to-Posterous Script: Another Update

A while ago I wrote a script to import my Twitpic photo posts to Posterous and posted it on this blog.

Even though Posterous now supplies their own working transfer tool, it has its limitations.  One person who tried that tool was unsatisfied, and tried my script.  He really liked the results, but he noticed some drawbacks to my script as well.  Here's what's new in my script v1.3.1:
  • New feature by request - #hashtags and @username mentions are now linked to the appropriate Twitter page in the body of the Posterous post.
  • Fix - issue where Twitpic now truncates the tweet text in the HTML title.  Switched to using the image alt text from the full page.  
  • Fix - Twitpic started escaping single and double quotes in the tweet text, which were showing up uninterpreted in the Posterous titles.  The script now handles them correctly.
  • Other changes
    • Only download the Full images by default (Scaled and thumbnails can be enabled by setting flags.)
    • Print an error message and pause for 5 seconds if a download fails (Twitpic was being unreliable during my testing.)
    • Other miscellaneous fixes and tweaks
Special thanks to @RyanMeray!
  • Update (v1.3.2): better regular expressions for @username and #hashtag formats. 
  • Update (v1.3.4): now optionally adds hashtags as post tags.
You can get the latest version here.

    Friday, July 16, 2010

    TwitPic to Posterous Export Script: Update

    In the time since I wrote my script which downloads all of a user's TwitPic posts (text included) and uploads them as Posterous posts, Posterous has come out with their own import tool.

    However, as noted in their blog post, TwitPic is currently blocking Posterous' servers, so someone came along and tried to use my script.  It turned out that the TwitPic site had been updated, and my script no longer worked.

    Well, I updated the script so that it works again.  The script can be found here.

    Wednesday, March 17, 2010

    TwitPic to Posterous Export Script

    Note: This post (and the script it contains) has been updated as of December 14, 2010.  (v1.4.0) The script can also be downloaded from my server here.
    Also, Posterous has done a lot of work on solving this problem since I wrote my script.   You can see their latest solutions here.

    Recently, I switched from TwitPic to Posterous as my method of posting phone pictures (and now video) to the Internet.  But since I switched, I didn't want to have my data history split in two, so I decided to write a script to download each of my TwitPic images with their associated text and date, and upload them to Posterous with the same information.

    Initially, I wanted to make one long post with all of the images, and their text below.  However, with the Posterous API, it isn't possible to refer to a specific image in your body text, so individual posts is the way I went.

    Along the way, I became familiar with yet another Linux command: curl.

    I love that Posterous has an API that (once you figure out curl) is pretty easy to use.  TwitPic, on the other hand, has absolutely zero support for exporting anything.  The fact that they're so non-user-centric and out-dated was a driving force in my switching.  The only reason I hadn't switched to img.ly already was because img.ly has a bug that prevents images sent from my phone from being posted, since my phone sends them without a file extension.  I worked with their tech support for a while, but they didn't fix it.  I got a new phone, but it was also a Samsung, and it did the same thing with images.  Oh, well.  Posterous is better.

    Anyway, here is the script:

    First run it with just the first two arguments, and it will download all of your TwitPic data, including thumbnail images.  Once you're satisfied, supply your Posterous User ID, Password, and Site ID.  (If you don't know your Site ID, run the script with your Posterous User ID, Password, and no Site ID, and it will query your Posterous site info as long as your Posterous credentials are valid.)

    Note: if you want to run this from Windows, you should install Cygwin (with, at a mimum, curl and sed) and run it from there.

    ./twitpic-to-posterous.sh [twitpic-id] [working-dir] [postrous-id] [posterous-password] [posterous-site-id] [skip-number]
    #!/bin/sh
    
    # Copyright 2010 Tim "burndive" of http://burndive.blogspot.com/ and http://tuxbox.blogspot.com/
    # This software is licensed under the Creative Commons GNU GPL version 2.0 or later.
    # License informattion: http://creativecommons.org/licenses/GPL/2.0/
    
    # This script was obtained from here:
    # http://tuxbox.blogspot.com/2010/03/twitpic-to-posterous-export-script.html
    
    RUN_DATE=`date +%F--%H-%m-%S`
    SCRIPT_VERSION_STRING="v1.4.0"
    
    TP_NAME=$1
    WORKING_DIR=$2
    P_ID=$3
    P_PW=$4
    P_SITE_ID=$5
    UPLOAD_SKIP=$6
    
    # Comma separated list of tags to apply to your posts
    P_TAGS="twitpic"
    # Whether or not to auto-post from Posterous
    P_AUTOPOST=0
    # Whether or not the Posterous posts are marked private
    P_PRIVATE=0
    
    # This is the default limit of the number of posts that can be uploaded per day
    P_API_LIMIT=50
    
    DOWNLOAD_FULL=1
    DOWNLOAD_SCALED=0
    DOWNLOAD_THUMB=0
    PREFIX=twitpic-$TP_NAME
    HTML_OUT=$PREFIX-all-$RUN_DATE.html
    UPLOAD_OUT=posterous-upload-$P_SITE_ID-$RUN_DATE.xml
    
    if [ -z "$TP_NAME" ]; then
      echo "You must supply a TP_NAME."
      exit
    fi
    if [ ! -d "$WORKING_DIR" ]; then
      echo "You must supply a WORKING_DIR."
      exit
    fi
    if [ -z "$UPLOAD_SKIP" ]; then
      UPLOAD_SKIP=0
    fi
    UPLOAD_SKIP_DIGITS=`echo $UPLOAD_SKIP | sed -e 's/[^0-9]//g'`
    if [ "$UPLOAD_SKIP" != "$UPLOAD_SKIP_DIGITS" ]; then
      echo "Invalid UPLOAD_SKIP: $UPLOAD_SKIP"
      exit
    fi
    
    cd $WORKING_DIR
    
    if [ -f "$HTML_OUT" ]; then
      rm -v $HTML_OUT
    fi
    
    # If Posterous username and password were supplied, but not site ID, query the server and exit.
    P_SITE_INFO_FILE=posterous-$P_SITE_ID.out
    if [ ! -z "$P_ID" ] && [ ! -z "$P_PW" ] && [ -z "$P_SITE_ID" ]; then
      echo "Getting Posterous account info..."
      curl -u "$P_ID:$P_PW" "http://posterous.com/api/getsites" -o $P_SITE_INFO_FILE
      SITE_ID_RET=`grep "<id>$P_SITE_ID</id>" $P_SITE_INFO_FILE`
      if [ -z "$SITE_ID_RET" ]; then
        echo "Please supply your Posterous Site ID as the fifth argument."
        echo "Here is the response from the Posterous server.  If you entered correct credentials, you should see your Site ID(s):"
        cat $P_SITE_INFO_FILE | tee -a $UPLOAD_OUT
        exit
      fi
    fi
    
    # Confirm that we have a valid Posterous Site ID
    if [ ! -z "$P_SITE_ID" ]; then
      echo "Getting Posterous account info..."
      curl -u "$P_ID:$P_PW" "http://posterous.com/api/getsites" -o $P_SITE_INFO_FILE
      SITE_ID_RET=`grep "<id>$P_SITE_ID</id>" $P_SITE_INFO_FILE`
      if [ -z "$SITE_ID_RET" ]; then
        echo "Make sure that you have supplied a valid Posterous Site ID as the fifth parameter.  If you don't know your Site ID, leave it out, and this script will query the server."
        echo "Here is the response from the Posterous server.  If you entered correct credentials, you should see your site ID(s):"
        cat $P_SITE_INFO_FILE | tee -a $UPLOAD_OUT
        exit
      fi
    fi
    
    MORE=1
    PAGE=1
    while [ $MORE -ne 0 ]; do
      echo PAGE: $PAGE
      FILENAME=$PREFIX-page-$PAGE.html
      if [ ! -s $FILENAME ]; then
        wget http://twitpic.com/photos/${TP_NAME}?page=$PAGE -O $FILENAME
        if [ ! -s "$FILENAME" ]; then
          echo "ERROR: could not get $FILENAME" | tee -a $LOG_FILE
          sleep 5
        fi
      fi
      if [ -z "`grep "More photos &gt;" $FILENAME`" ]; then
        MORE=0
      else
        PAGE=`expr $PAGE + 1`
      fi
    done
    
    ALL_IDS=`cat $PREFIX-page-* | grep -Eo "<a href=\"/[a-zA-Z0-9]+\">" | grep -Eo "/[a-zA-Z0-9]+" | grep -Eo "[a-zA-Z0-9]+" | sort -r | xargs`
    
    # For Testing
    #ALL_IDS="1kdjc"
    
    COUNT=0
    LOG_FILE=$PREFIX-log-$RUN_DATE.txt
    
    echo $ALL_IDS | tee -a $LOG_FILE
    
    for ID in $ALL_IDS; do
      COUNT=`expr $COUNT + 1`
      echo $ID: $COUNT | tee -a $LOG_FILE
    
      echo "Processing $ID..."
      FULL_HTML=$PREFIX-$ID-full.html
      if [ ! -s "$FULL_HTML" ]; then
        wget http://twitpic.com/$ID/full -O $FULL_HTML
        if [ ! -s "$FULL_HTML" ]; then
          echo "ERROR: could not get FULL_HTML for $ID" | tee -a $LOG_FILE
          sleep 5
        fi
      fi
      TEXT=`grep "<img src=" $FULL_HTML | tail -n1 | grep -oE "alt=\"[^\"]*\"" | sed \
            -e 's/^alt="//'\
            -e 's/"$//'\
            -e "s/&#039;/'/g"\
            -e 's/&quot;/"/g'\
            `
      if [ "$TEXT" = "" ]; then
        TEXT="Untitled"
      fi
      echo "TEXT: $TEXT" | tee -a $LOG_FILE
      # Recognize hashtags and username references in the tweet
      TEXT_RICH=`echo "$TEXT" | sed \
            -e 's/\B\@\([0-9A-Za-z_]\+\)/\@<a href="http:\/\/twitter.com\/\1">\1<\/a>/g' \
            -e 's/\#\([0-9A-Za-z_-]*[A-Za-z_-]\+[0-9A-Za-z_-]*\)/<a href="http:\/\/twitter.com\/search\?q\=%23\1">\#\1<\/a>/g' \
            `
      echo "TEXT_RICH: $TEXT_RICH" | tee -a $LOG_FILE
    
      # Convert hashtags into post tags
      P_TAGS_POST=$P_TAGS`echo "$TEXT" | sed \
            -e 's/\#\([^A-Za-z_-]\)*\B//g' \
            -e 's/^[^\#]*$//g' \
            -e 's/[^\#]*\(\#\([0-9A-Za-z_-]*[A-Za-z_-]\+[0-9A-Za-z_-]*\)\)[^\#]*\(\#[0-9]*\B\)*/,\2/g' \
            `
      # Uncomment if you don't want hashtags converted into post tags
      #P_TAGS_POST=$P_TAGS
    
      # Add custom tags from a file (optional).  The file is formatted like this:
      # ,tag1,tag2,tag3
      TAGS_FILE=$PREFIX-$ID-tags-extra.txt
      if [ -s "$TAGS_FILE" ]; then
        P_TAGS_POST=$P_TAGS_POST`cat $TAGS_FILE`
      fi
      echo "P_TAGS_POST: $P_TAGS_POST" | tee -a $LOG_FILE
    
      TEXT_FILE=$PREFIX-$ID-text.txt
      if [ ! -s $TEXT_FILE ]; then
        echo "$TEXT" > $TEXT_FILE
      fi
      FULL_URL=`grep "<img src=" $FULL_HTML | grep -Eo "src=\"[^\"]*\"" | grep -Eo "http://[^\"]*"`
      echo "FULL_URL: $FULL_URL" | tee -a $LOG_FILE
    
      SCALED_HTML=$PREFIX-$ID-scaled.html
      if [ ! -s "$SCALED_HTML" ]; then
        wget http://twitpic.com/$ID -O $SCALED_HTML
        if [ ! -s "$SCALED_HTML" ]; then
          echo "ERROR: could not get SCALED_HTML for $ID" | tee -a $LOG_FILE
          sleep 5
        fi
      fi
      SCALED_URL=`grep "id=\"photo-display\"" $SCALED_HTML | grep -Eo "http://[^\"]*" | head -n1`
      echo "SCALED_URL: $SCALED_URL" | tee -a $LOG_FILE
      POST_DATE=`grep -Eo "Posted on [a-zA-Z0-9 ,]*" $SCALED_HTML | sed -e 's/Posted on //'`
      echo "POST_DATE: $POST_DATE" | tee -a $LOG_FILE
    
      THUMB_URL=`cat $PREFIX-page-* | grep -E "<a href=\"/$ID\">" | grep -Eo "src=\"[^\"]*\"" | head -n1 | sed -e 's/src=\"//' -e 's/\"$//'`
      echo "THUMB_URL: $THUMB_URL" | tee -a $LOG_FILE
    
      EXT=`echo "$FULL_URL" | grep -Eo "[a-zA-Z0-9]+\.[a-zA-Z0-9]+\?" | head -n1 | grep -Eo "\.[a-zA-Z0-9]+"`
      if [ -z "$EXT" ]; then
        EXT=`echo "$FULL_URL" | grep -Eo "\.[a-zA-Z0-9]+$"`
      fi
      echo "EXT: $EXT"
      if [ "$DOWNLOAD_FULL" -eq 1 ]; then
        FULL_FILE="$PREFIX-$ID-full$EXT"
        if [ ! -s $FULL_FILE ]; then
          wget "$FULL_URL" -O $FULL_FILE
          if [ ! -s "$FULL_FILE" ]; then
            echo "ERROR: could not get FULL_URL for $ID: $FULL_URL" | tee -a $LOG_FILE
            sleep 5
          fi
        fi
      fi
      if [ "$DOWNLOAD_SCALED" -eq 1 ]; then
        SCALED_FILE=$PREFIX-$ID-scaled$EXT
        if [ ! -s $SCALED_FILE ]; then
          wget "$SCALED_URL" -O $SCALED_FILE
          if [ ! -s "$SCALED_FILE" ]; then
            echo "ERROR: could not get SCALED_URL for $ID: $SCALED_URL" | tee -a $LOG_FILE
            sleep 5
          fi
        fi
      fi
      if [ "$DOWNLOAD_THUMB" -eq 1 ]; then
        THUMB_FILE=$PREFIX-$ID-thumb$EXT
        if [ ! -s $THUMB_FILE ]; then
          wget "$THUMB_URL" -O $THUMB_FILE
          if [ ! -s "$THUMB_FILE" ]; then
            echo "ERROR: could not get THUMB_URL for $ID: $THUMB_URL" | tee -a $LOG_FILE
            sleep 5
          fi
        fi
      fi
    
      BODY_TEXT="$TEXT_RICH <p>[<a href=http://twitpic.com/$ID>Twitpic</a>]</p>"
    
      # Format the post date correctly
      YEAR=`echo "$POST_DATE" | sed -e 's/[A-Z][a-z]* [0-9]*, //'`
      DAY=`echo "$POST_DATE" | sed -e 's/[A-Z][a-z]* //' -e 's/, [0-9]*//'`
      MONTH=`echo "$POST_DATE" | sed -e 's/ [0-9]*, [0-9]*//' | sed \
        -e 's/January/01/' \
        -e 's/February/02/' \
        -e 's/March/03/' \
        -e 's/April/04/' \
        -e 's/May/05/' \
        -e 's/June/06/' \
        -e 's/July/07/' \
        -e 's/August/08/' \
        -e 's/September/09/' \
        -e 's/October/10/' \
        -e 's/November/11/' \
        -e 's/December/12/' \
        `
      # Adjust the time to local midnight when west of GMT
      HOURS_LOC=`date | grep -Eo " [0-9]{2}:" | sed -e 's/://' -e 's/ //'`
      HOURS_UTC=`date -u | grep -Eo " [0-9]{2}:" | sed -e 's/://' -e 's/ //'`
      HOURS_OFF=`expr $HOURS_UTC - $HOURS_LOC + 7`
      echo "HOURS_LOC: $HOURS_LOC"
      echo "HOURS_UTC: $HOURS_UTC"
      echo "HOURS_OFF: $HOURS_OFF"
      if [ "$HOURS_OFF" -lt 0 ]; then
        # We're east of GMT, do not adjust
        HOURS_OFF=0
      fi
      if [ "$HOURS_OFF" -lt 10 ]; then
        HOURS_OFF=0$HOURS_OFF
      fi
      if [ "$DAY" != "" ] && [ "$DAY" -lt 10 ]; then
        DAY=0$DAY
      fi
      DATE_FORMATTED="$YEAR-$MONTH-$DAY-$HOURS_OFF:00"
      echo "DATE_FORMATTED: $DATE_FORMATTED" | tee -a $LOG_FILE
    
      echo "<p><img src='$FULL_FILE' alt='$TEXT' title='$TEXT' /></p>" >> $HTML_OUT
      echo "$BODY_TEXT" >> $HTML_OUT
      echo "  Post date: $DATE_FORMATTED; Count: $COUNT" >> $HTML_OUT
    
      # Upload this Twitpic data to Posterous
      if [ ! -z "$P_SITE_ID" ]; then
    
        # First make sure we're under the API upload limit
        if [ "$COUNT" -le "$UPLOAD_SKIP" ]; then
          echo Skipping upload...
          continue
        fi
        if [ "$COUNT" -gt "`expr $UPLOAD_SKIP + $P_API_LIMIT`" ]; then
          echo "Skipping upload due to daily Posterous API upload limit of $P_API_LIMIT."
          echo "To resume uploading where we left off today, supply UPLOAD_SKIP parameter of `expr $UPLOAD_SKIP + $P_API_LIMIT`."
          continue
        fi
    
        P_OUT_FILE="posterous-$P_SITE_ID-$ID.out"
        if [ -s "$P_OUT_FILE" ]; then
          rm "$P_OUT_FILE"
        fi
        echo "Uploading Twitpic image..."
        curl -u "$P_ID:$P_PW" "http://posterous.com/api/newpost" -o "$P_OUT_FILE" \
          -F "site_id=$P_SITE_ID" \
          -F "title=$TEXT" \
          -F "autopost=$P_AUTOPOST" \
          -F "private=$P_PRIVATE" \
          -F "date=$DATE_FORMATTED" \
          -F "tags=$P_TAGS_POST" \
          -F "source=burndive's Twitpic-to-Posterous script $SCRIPT_VERSION_STRING" \
          -F "sourceLink=http://tuxbox.blogspot.com/2010/03/twitpic-to-posterous-export-script.html" \
          -F "body=$BODY_TEXT" \
          -F "media=@$FULL_FILE"
        cat $P_OUT_FILE  | tee -a $UPLOAD_OUT
      fi
    done
    echo Done.
    CC-GNU GPL
    This software is licensed under the CC-GNU GPL version 2.0 or later.

    PS: If you use my code, I appreciate comments to let me know, and any feedback you may have, especially if it's not working right for you, but also just to say thanks.

    For convenience, you can download this script from my server.

    Monday, April 13, 2009

    That's What She sed

    Lately, I've been uploading pictures to Twitter from my phone using TwitPic. Basically, you send them to a TwitPic e-mail address via multimedia messaging, and they are automatically posted to your Twitter account, along with the text from the subject. This all works quite well, and they even supply an RSS feed of your pictures, which you can take and (among other thing) put on your blog's sidebar. The problem was, when I put it in my blog sidebar, there was no thumbnail image. Other feeds that had images in them would have thumbnails, but not this one. This one just had a text link to the picture page. I found that disappointing. So I examined feeds that showed thumbnails and the TwitPic feed to see what the difference was. Feeds that contained images within the feed content showed up in the Blogger widget with a thumbnail. But the TwitPic feed showed images. What was the difference? The difference turned out to be CDATA. CDATA is a way to tell a feed reader, "Don't try to decipher my contents, just pass them along and leave the rendering to the end user application." It so happens that TwitPic's thumbnail images are within a CDATA block, and Blogger obediently ignores the CDATA contents when looking for images to display as a thumbnail. So, how do I fix that? I need to read the feed, and for each item, locate the line that contains the thumbnail URL, and create a new attribute containing the thumbnail in a format that is decipherable to Blogger's widget. Using my digg feed as a model, I figured out what the end result should look like, but how to achieve it? First, I tried Yahoo Pipes. Yahoo has a tool for processing feeds with a number of tools, controlled by a graphical pipe-looking interface. The problem is, none of the tools that I could find would add an attribute based on the transformed contents of another attribute. There were widgets that came close, but I couldn't get it to work, so I decided to host the feed myself and modify it using sed. I had never used sed before, except when the exact command was given, so I didn't know how to use it, but I knew that it was a powerful enough tool to get the job done. So I created a shell script on my Linux box, and a cron job to run it. The script basically downloaded the RSS feed from TwitPic to a local file, and then called sed on it with a particular set of parameters designed to extract the necessary information, and add the appropriate information in a format that is decipherable to Blogger. In order to understand sed, I searched the Internet for a tutorial, and found this page from the Gentoo Linux Documentation to be the most helpful. My sed command does two things, which are piped together:
    1. It adds an xmlns:media declaration, which allows me to use the media tag later on.
    2. It examines each CDATA line with the thumbnail URL, and below it, it adds a line with the media:thumbnail tag and the URL extracted from above.
    sed -e 's/<rss version="[^"]*"/& xmlns:media="http:\/\/search.yahoo.com\/mrss\/"/g' $TMP_FILE | sed -e 's/\(http:\/\/twitpic.com\/show\/thumb\/[^"]*\).*/&\n <media:thumbnail url="\1" height="150" width="150" \/>/g' > $FEED_FILE
    I know it's possible to consilidate the two sed commands into one and do it in one pass, but this works. I may tweak it in further revisions. It is not necessary to use a yahoo-defined media tag, so I might modify the script later on to simply transform the CDATA portion into parseable encoded HTML. I might also add that I'm using Feedburner to host the feed. Basically, I change the file on my server, and Feedburner goes there to get it, and offers it to the rest of the world. That way if my server is offline, the feed is still active and available, and I don't have to deal with the traffic, just the Feedburner hits. If anyone else wants their TwitPic feed to have thumbnails available, let me know, and I can set one up for you on my server through Feedburner. (It's pretty easy, since the TwitPic username is passed in to the script as a parameter). I can't guarantee anything, but since it's in my interest to keep the script working and up-to-date, you don't have much to worry about. All I need to know is your TwitPic (Twitter) username.
    • Update (2009-04-16): I have modified the code to accept all image formats, and be shorter.