<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A Random String of Bits &#187; twitter</title>
	<atom:link href="http://stringofbits.net/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://stringofbits.net</link>
	<description>Sequences of bytes about Technology, Programming, Gaming, Doctor Who, and more</description>
	<lastBuildDate>Thu, 26 Apr 2012 19:58:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='stringofbits.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A Random String of Bits &#187; twitter</title>
		<link>http://stringofbits.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://stringofbits.net/osd.xml" title="A Random String of Bits" />
	<atom:link rel='hub' href='http://stringofbits.net/?pushpress=hub'/>
		<item>
		<title>Twitter from the command line</title>
		<link>http://stringofbits.net/2009/07/02/twitter-from-the-command-line/</link>
		<comments>http://stringofbits.net/2009/07/02/twitter-from-the-command-line/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:38:30 +0000</pubDate>
		<dc:creator>Anna Wiggins</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://stringofbits.net/?p=129</guid>
		<description><![CDATA[I&#8217;ve recently started playing with twitter. A nice way to use it via the command-line (using curl) was suggested here. I have taken that and improved slightly on it. Here is the result: #!/bin/sh echo -n "twitter&#62; " read text while [ ${#text} -gt 140 ]; do echo echo "Message too long; used ${#text}/140 characters." [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stringofbits.net&#038;blog=23443234&#038;post=129&#038;subd=stringofbits&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started playing with twitter.  A nice way to use it via the command-line (using curl) was suggested <a href="http://binnyva.blogspot.com/2007/03/using-twitter-part-1-command-line.html">here</a>.  I have taken that and improved slightly on it.</p>
<p><span id="more-129"></span></p>
<p>Here is the result:</p>
<blockquote><p><code>#!/bin/sh<br />
echo -n "twitter&gt; "<br />
read text</p>
<p>while [ ${#text} -gt 140 ]; do</p>
<p>echo<br />
echo "Message too long; used ${#text}/140 characters."<br />
echo<br />
echo -n "twitter&gt; "<br />
read text</p>
<p>done</p>
<p>echo<br />
echo "Message is ${#text}/140 characters.  Press enter to post, or Ctrl+C to cancel."<br />
read</p>
<p>curl --basic --user "username:password" --data-ascii "status=`echo $text|tr ' ' '+'`" "http://twitter.com/statuses/update.json" &amp;&gt; /dev/null<br />
</code>
</p></blockquote>
<p>To use the script, copy all of that into a file somewhere in your path, then make the file executable (e.g., <code>chmod 755 /usr/local/bin/twitter</code>).  Now you can type &#8216;twitter&#8217;, type in your tweet, and you&#8217;re done!</p>
<p>I even set up fluxbox so that mod4+t launches a terminal with the script running.  To do that, I added this to ~/.fluxbox/keys:</p>
<blockquote><p>
<code><br />
Mod4 t :Exec xterm -e "twitter"<br />
</code>
</p></blockquote>
<p>If you&#8217;re not familiar with &#8216;mod4&#8242;, it is the Windows key on most PC keyboards.</p>
<p>I&#8217;ll eventually get around to writing a slightly more full-featured twitter updater in c or c++.  Until then, enjoy this script!</p>
<br />Posted in Technology Tagged: linux, programming, twitter <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stringofbits.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stringofbits.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stringofbits.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stringofbits.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stringofbits.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stringofbits.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stringofbits.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stringofbits.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stringofbits.net&#038;blog=23443234&#038;post=129&#038;subd=stringofbits&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stringofbits.net/2009/07/02/twitter-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a6c6c99ccd3e2bbaec318a52fb3d43c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">annabunches</media:title>
		</media:content>
	</item>
	</channel>
</rss>
