<?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>itsAnimesh.com &#187; Command Line</title>
	<atom:link href="http://itsanimesh.com/tag/command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://itsanimesh.com</link>
	<description>A Techie Gyaan Vyaan Blog.</description>
	<lastBuildDate>Mon, 06 Sep 2010 18:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Howto : Twitter from Command Line&#8230;</title>
		<link>http://itsanimesh.com/2010/01/25/howto-twitter-from-command-line/</link>
		<comments>http://itsanimesh.com/2010/01/25/howto-twitter-from-command-line/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 09:07:01 +0000</pubDate>
		<dc:creator>Animesh Kumar</dc:creator>
				<category><![CDATA[Techi Gyaan]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://itsanimesh.com/?p=1593</guid>
		<description><![CDATA[This is a tutorial explaining how to post to Twitter using command-line in Linux, without needing to even open up your web browser&#8230;. First, install the curl package: sudo apt-get install curl Next, create a script anywhere in your $PATH, for example tweet.sh inside ~/bin, where ~ is your home directory (make sure ~/bin is [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tutorial explaining how to post to Twitter using command-line in Linux, without needing to even open up your web browser&#8230;.</p>
<p>First, install the curl package:</p>
<pre>sudo apt-get install curl</pre>
<p>Next, create a script anywhere in your <strong>$PATH</strong>, for example <strong>tweet.sh</strong> inside <strong>~/bin</strong>, where ~ is your home directory (make sure ~/bin is included in your $PATH variable, in case echo $PATH doesn&#8217;t return it, edit <strong>~/.bashrc</strong> and add a line like this: <strong>export PATH=/home/USER/bin/:$PATH</strong>)&#8230;</p>
<p>The script <strong>tweet.sh</strong> should contain the following:<span id="more-1593"></span><br />
<code> </code></p>
<p><code> </code></p>
<p><code> </code></p>
<p><code></p>
<pre>#!/bin/sh

############EDIT THE FOLLOWING LINES...###########################
user="USERNAME"
pass="PASSWORD"
##################################################################

######################DO NOT EDIT BELOW THIS######################
tweet="${@}"

if [ $(echo "${tweet}" | wc -c) -gt 140 ]; then
    echo "FATAL: The tweet is longer than 140 characters!"
    exit 1
fi

curl -k -u ${user}:${pass} -d status="${tweet}" https://twitter.com/statuses/update.xml &gt;/dev/null 2&gt;&amp;1

if [ "$?" == "0" ]; then
    echo "Successful tweet!"
fi</pre>
<p></code></p>
<p>Replace <strong>USERNAME </strong>and <strong>PASSWORD </strong>with your Twitter username and password, and then make the script executable:</p>
<pre>chmod 755 ~/bin/tweet.sh</pre>
<p>And now test it.. Just use it as :</p>
<pre>tweet.sh YOUR MESSAGE</pre>
<p>This should be all&#8230;</p>
<p>If you don&#8217;t want to copy paste the code for tweet.sh then use the following link to download <a href="http://itsanimesh.com/wp-content/uploads/2010/01/tweet.txt">tweet.txt</a> and RENAME it as tweet.sh</p>
]]></content:encoded>
			<wfw:commentRss>http://itsanimesh.com/2010/01/25/howto-twitter-from-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
