<?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>Uncertain Binary Thoughts &#187; twitter</title>
	<atom:link href="http://ankurs.com/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankurs.com</link>
	<description>01110100110101010101011101100010</description>
	<lastBuildDate>Sun, 01 Jan 2012 18:20:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Get updates of completed torrents via SMS</title>
		<link>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/</link>
		<comments>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 12:13:16 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Special]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[ktorrent]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[twit]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=489</guid>
		<description><![CDATA[This Sunday when i was giving DBUS a look and thinking about all the cool things possible with it, one of my friend came asking how can he control his torrents from anywhere and i thought controlling is ok, do you want SMS updates??, i fired up qdbusviewer and there it was a simple way&#8230;]]></description>
			<content:encoded><![CDATA[<p>This Sunday when i was giving <a href="http://www.freedesktop.org/wiki/Software/dbus">DBUS</a> a look and thinking about all the cool things possible with it, one of my friend came asking how can he control his torrents from anywhere and i thought controlling is ok, do you want SMS updates??, i fired up qdbusviewer and there it was a simple way to get sms notifications of finished torrents using well twitter and ktorrent, so here are the steps<br />
1) setup your cell phone to recieve SMS updates in twitter,<br />
2) get one more twitter account lets say ktorrent, follow ktorrent and turn device updates on,<br />
3) now save the script below say as torrenttwit.py<br />
4) now enter this ktorrent account username and password in the script below,<br />
5) start ktorrent if not already started, now run the script by typing &#8220;python torrenttwit.py&#8221;</p>
<pre>import dbus,base64,urllib2,urllib
from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default=True)
username="username"
password="password"

def tweet(msg):
        request = urllib2.Request('http://twitter.com/statuses/update.json')
        request.add_header('Authorization', 'Basic %s' % base64.encodestring('%s:%s' % (username,password))[:-1])
        request.add_data(urllib.urlencode({'status': msg.encode('utf-8')}))
        opener = urllib2.build_opener()
        req= opener.open(request)

s = dbus.SessionBus()
kt = s.get_object("org.ktorrent.ktorrent","/core")

def update(k):
        torrent = s.get_object("org.ktorrent.ktorrent","/torrent/"+k)
        name = torrent.get_dbus_method("name","org.ktorrent.torrent")
        tweet("ktorrent: finished " +name())

kt.connect_to_signal("finished",update)

import gobject
loop = gobject.MainLoop()
loop.run()
</pre>
<p>you are done, now whenever a torrent finishes the script will twit and you will receive an SMS update<br />
enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Twit from command line (Linux)</title>
		<link>http://ankurs.com/2007/12/twit-from-command-line-linux/</link>
		<comments>http://ankurs.com/2007/12/twit-from-command-line-linux/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 07:45:28 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Special]]></category>
		<category><![CDATA[ankur]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://warofwords.wordpress.com/2007/12/04/twit-from-command-line-linux/</guid>
		<description><![CDATA[Here is a thing that i found during searching for a completely different things, you can update your Twitter status simply by using curl which is most of the time installed by default so here is the command /usr/bin/curl -u username:password -d status="your tweet" http://twitter.com/statuses/update.xml it simply updates your twitter status, this is extremely simple&#8230;]]></description>
			<content:encoded><![CDATA[<p>Here is a thing that i found during searching for a completely different things, you can update your Twitter status simply by using curl which is most of the time installed by default so here is the command<br />
<code>/usr/bin/curl -u username:password -d status="your tweet" http://twitter.com/statuses/update.xml</code><br />
it simply updates your twitter status, this is extremely simple and could easily be used to update status, but the problem is that it contains your password   and you dont want to display your password so you can make a simple script for it which asks you for the tweet and displays if successful or not<br />
<code>#!/bin/sh<br />
echo Post your tweet.......<br />
read tweet<br />
/usr/bin/curl -u &lt;username&gt;:&lt;password&gt; -d status="$tweet" http://twitter.com/statuses/update.xml<br />
if [[ "$?" == 0 ]];<br />
then<br />
echo Updated successfuly!!!!<br />
exit 0<br />
else<br />
echo Something went wrong try again!!!!<br />
exit 1<br />
fi</code><br />
to make it just login as root by &#8216;sudo -i&#8217; or &#8216;su&#8217; and type <code>gedit /usr/local/bin/twit</code> now paste the script and replace &lt;username&gt; and &lt;password&gt; with username and password of your twitter account and save the file, we will change the permissions for the file and make it  executable by typing <code>chmod +x /usr/local/bin/twit</code> <code></code> all done now when you want to twit just type twit on command line and let the world know what you are doing.<br />
PS:- if you are on twitter feel free to add me <a href="http://twitter.com/ankur">http://twitter.com/ankur</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2007/12/twit-from-command-line-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

