<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MrBalky Heavy Industries &#187; twitpic</title>
	<atom:link href="http://www.mrbalky.com/tag/twitpic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mrbalky.com</link>
	<description>Fat free with endorphins, anti-oxidants, bioflavonoids, creatine, glucosamine and caffeine!</description>
	<lastBuildDate>Fri, 27 Jan 2012 23:23:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>TwitPic upload hack</title>
		<link>http://www.mrbalky.com/2009/01/13/twitpic-upload-hack/</link>
		<comments>http://www.mrbalky.com/2009/01/13/twitpic-upload-hack/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 01:46:48 +0000</pubDate>
		<dc:creator>mrbalky</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[twitpic]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.mrbalky.com/?p=304</guid>
		<description><![CDATA[Some Twitter users have been using TwitPic to link photos to tweets. I, on the other hand, have been using Flickr and Snipr. It&#8217;s a PITA, so I&#8217;m giving TwitPic a whirl. Sadly, Digsby, does not support TwitPic, and I&#8217;m not installing yet another app. TwitPic has an API, so I rolled my own simple [...]]]></description>
			<content:encoded><![CDATA[<p>Some <a href="http://twitter.com">Twitter</a> users have been using <a href="http://twitpic.com/">TwitPic</a> to link photos to tweets.  I, on the other hand, have been using Flickr and <a href="http://snipr.com/">Snipr</a>.  It&#8217;s a PITA, so I&#8217;m giving TwitPic a whirl.  Sadly, <a href="http://www.digsby.com/">Digsby</a>, does not support TwitPic, and I&#8217;m not installing yet another app.</p>
<p>TwitPic has an <a href="http://twitpic.com/api.do">API</a>, so I rolled my own simple uploader with <a href="http://www.cygwin.com/">cygwin</a> and <a href="http://curl.haxx.se/">curl</a>.  There&#8217;s no doubt in my mind that I&#8217;ve reinvented the wheel here&#8230;</p>
<p><em>Standard disclaimer applies: this is quick n’ dirty(tm)</em>:</p>
<pre>
<code>#!/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 &lt;enter&gt; to continue" bogus</code>
</pre>
<p>Create a desktop shortcut with uid and password:</p>
<pre><code>C:\cygwin\bin\sh.exe ~/twitpic.sh --userid-- --password--</code></pre>
<p>Now just drag and drop the photo onto the desktop shortcut.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mrbalky.com/2009/01/13/twitpic-upload-hack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

