<?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>Darius Aliabadi &#187; Openbox</title>
	<atom:link href="http://blog.wednesdaymorning.co.uk/category/linux/openbox-linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wednesdaymorning.co.uk</link>
	<description>a blog dictating the digital life off me</description>
	<lastBuildDate>Wed, 01 Sep 2010 21:41:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Taming the Python</title>
		<link>http://blog.wednesdaymorning.co.uk/2009/11/taming-the-python/</link>
		<comments>http://blog.wednesdaymorning.co.uk/2009/11/taming-the-python/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 18:32:58 +0000</pubDate>
		<dc:creator>Darius</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Crunchbang]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Openbox]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.wednesdaymorning.co.uk/?p=195</guid>
		<description><![CDATA[Hey Guys,
I&#8217;ve been learning some python over the last few weeks, thought I would give it coding a Openbox Pipe Menu a go. It&#8217;s not very useful and some of the guys in the Crunchbang Forums helped me to fix my bugs. Here is the code:
#!/usr/bin/env python -W ignore::DeprecationWarning
import sys
import cgi
import twitter

if __name__ == "__main__":
 [...]]]></description>
			<content:encoded><![CDATA[<p>Hey Guys,</p>
<p>I&#8217;ve been learning some python over the last few weeks, thought I would give it coding a Openbox Pipe Menu a go. It&#8217;s not very useful and some of the guys in the Crunchbang Forums helped me to fix my bugs. Here is the code:</p>
<pre class="brush:python">#!/usr/bin/env python -W ignore::DeprecationWarning
import sys
import cgi
import twitter

if __name__ == "__main__":
 twit = twitter.Api(username="", password="")
 status = twit.GetFriendsTimeline()
 print "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;"
 print "&lt;openbox_pipe_menu&gt;"
 print"    &lt;separator label=\"Twitter\" /&gt;"

 for u in status:
    tweet = u.text
    tweet = tweet.replace("\"", "'")
    tweet = tweet.encode("utf-8")
    tweet = cgi.escape(tweet)

    print "    &lt;menu id=\"%s\" label=\"%s\"&gt;" % (u.id, tweet)
    print "        &lt;item label=\"View Tweet\"&gt;&lt;action name=\"Execute\"&gt; &lt;execute&gt;firefox http://twitter.com/%s/status/%s\ &lt;/execute&gt; &lt;/action&gt; &lt;/item&gt;" % ( cgi.escape(u.user.screen_name), u.id)
    print "        &lt;item label=\"Tweet by %s\" /&gt;" % (cgi.escape(u.user.name))
    print "        &lt;item label=\"%s\" /&gt;" % (cgi.escape(u.relative_created_at))
    print "    &lt;/menu&gt;"

 print "&lt;/openbox_pipe_menu&gt;"
 sys.exit(0)</pre>
<p>I don&#8217;t suggest you make use of it, this is the alpha version but I intend to add some conversation thread and caching into it at some point. I&#8217;m also learning some perl but I haven&#8217;t really made anything other than programs to test things.</p>
<p>I&#8217;ll try and post something tomorrow, after all the site is called Wednesday Morning.</p>
<p>Darius</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wednesdaymorning.co.uk/2009/11/taming-the-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
