<?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>Ian Winter &#187; bash</title>
	<atom:link href="http://ianwinter.co.uk/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://ianwinter.co.uk</link>
	<description>Have you found the instructions yet?</description>
	<lastBuildDate>Wed, 14 Sep 2011 22:16:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tweeting from the command line</title>
		<link>http://ianwinter.co.uk/2010/04/21/tweeting-from-the-command-line/</link>
		<comments>http://ianwinter.co.uk/2010/04/21/tweeting-from-the-command-line/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 16:22:27 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://ianwinter.co.uk/?p=1120</guid>
		<description><![CDATA[I read an article over at OS X Daily about posting a tweet from the command line using the twitter API. Taking this one step further here&#8217;s a handy little script that&#8217;ll even stop you posting nothing and stuff that&#8217;s too long. Save the file as &#8220;tweet&#8221; and make sure it&#8217;s in the path with [...]]]></description>
			<content:encoded><![CDATA[<p>I read an article over at <a href="http://osxdaily.com/2010/04/20/post-a-twitter-update-via-the-command-line/" target="_blank">OS X Daily</a> about posting a tweet from the command line using the twitter API. Taking this one step further here&#8217;s a handy little script that&#8217;ll even stop you posting nothing and stuff that&#8217;s too long.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
TWEET=$1
TWEETLEN=${#TWEET}
if [ $TWEETLEN -eq 0 ] || [ $TWEETLEN -gt 140 ]; then
	if [ $TWEETLEN -gt 140 ]; then
		let EXTRA=$TWEETLEN-140
		echo &quot;Usage: tweet \&quot;message\&quot; (140 chars or less, you're $EXTRA over)&quot;
	else
		echo &quot;Usage: tweet \&quot;message\&quot; (140 chars or less)&quot;
	fi
	exit 1
else
	curl -u username:password -d status=&quot;$1&quot; http://twitter.com/statuses/update.xml
fi
exit 0
</pre>
<p>Save the file as &#8220;tweet&#8221; and make sure it&#8217;s in the path with executable permissions of 755.</p>
<pre class="brush: bash; light: true; title: ; notranslate">chmod 755 tweet</pre>
]]></content:encoded>
			<wfw:commentRss>http://ianwinter.co.uk/2010/04/21/tweeting-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

