<?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>Dereferenced.com &#187; GitHub</title>
	<atom:link href="http://www.dereferenced.com/topics/github/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dereferenced.com</link>
	<description>A preponderance of Perl, an excess of XML, and additional alliterations.</description>
	<lastBuildDate>Sun, 29 Aug 2010 23:16:38 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Perl Module Monday: Net::Twitter(::Lite)</title>
		<link>http://www.dereferenced.com/2009/09/28/perl-module-monday-nettwitterlite/</link>
		<comments>http://www.dereferenced.com/2009/09/28/perl-module-monday-nettwitterlite/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 05:42:59 +0000</pubDate>
		<dc:creator>rjray</dc:creator>
				<category><![CDATA[CPAN]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[module-monday]]></category>

		<guid isPermaLink="false">http://www.dereferenced.com/?p=62</guid>
		<description><![CDATA[(If I keep covering multiple modules in a post, I&#8217;m going to have to change the title and tag I use&#8230;)
I generally try to use these posts to highlight lesser-known modules, and I imagine that the Net::Twitter module is fairly higher-profile than most of my previous choices. But are you familiar with Net::Twitter::Lite, as well?
It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>(If I keep covering multiple modules in a post, I&#8217;m going to have to change the title and tag I use&#8230;)</p>
<p>I generally try to use these posts to highlight lesser-known modules, and I imagine that the <a href="http://search.cpan.org/dist/Net-Twitter">Net::Twitter</a> module is fairly higher-profile than most of my previous choices. But are you familiar with <a href="http://search.cpan.org/dist/Net-Twitter-Lite">Net::Twitter::Lite</a>, as well?</p>
<p>It&#8217;s not unusual for CPAN to offer more than one solution to a given problem. The wide range of XML parsers is a testament to this. And when a subject is popular, the odds are even greater that people may choose to &#8220;roll their own&#8221; rather than trying to contribute to an existing effort. Fortunately, the interface to the social messaging service <a href="http://twitter.com">Twitter</a> has been spared this. Maybe it&#8217;s because the source code is <a href="http://github.com/semifor/Net-Twitter">hosted on GitHub</a>, and thus it is easier for people to contribute. Whatever the reason, the only real competition to Net::Twitter for basic Twitter API usage is Net::Twitter::Lite. And it&#8217;s not actually a competitor in the general sense.</p>
<p>Rather than representing a competing implementation, Net::Twitter::Lite came about as an (almost completely) interface-compatible alternative to Net::Twitter after it was refactored to use Moose internally. While it doesn&#8217;t have 100% of the features that Net::Twitter has, both modules strive for 100% coverage of Twitter&#8217;s API. Where N::T::Lite runs without the additional requirement of Moose, N::T gives you finer-grained control over which parts of the API are loaded and made available to connection objects.</p>
<p>I&#8217;ve used both modules, and can attest to the fact that the interface is kept consistent between them. At $DAY_JOB I authored a tool to echo data to a Twitter stream, for which N::T::L was the best choice as it had the fewest dependencies and our needs did not call for the additional functionality of N::T. My Twitter-bot (<a href="http://twitter.com/cpan_linked">cpan_linked</a>) was written with N::T in the pre-Moose days, and has not had a single problem since I seamlessly upgraded N::T to the Moose-based version. As I work on the next generation CPAN-bot, I&#8217;ll be using the OAuth support, as well as possibly the search API. Since it will be a long-running daemon, I&#8217;ll stick with the more-featureful N::T for it. But thanks to the diligence of the modules&#8217; authors, I could just as easily swap between them at will.</p>
<p>If you&#8217;re planning to interface to Twitter from Perl, these two modules should be your starting point. But be sure to look at the <a href="http://search.cpan.org/search?query=twitter&amp;mode=all">other Twitter-oriented modules</a>, just to be sure. There&#8217;s a lot of activity around this API, and Perl developers have kept on top of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereferenced.com/2009/09/28/perl-module-monday-nettwitterlite/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Parsing HTTP Headers</title>
		<link>http://www.dereferenced.com/2009/09/13/parsing-http-headers/</link>
		<comments>http://www.dereferenced.com/2009/09/13/parsing-http-headers/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 04:53:07 +0000</pubDate>
		<dc:creator>rjray</dc:creator>
				<category><![CDATA[CPAN]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.dereferenced.com/?p=51</guid>
		<description><![CDATA[So, I&#8217;ve volunteered to co-maintain the HTTP::Parser CPAN module. I did this because I&#8217;ve been looking for something I can use in RPC::XML::Server instead of my current approach, which is to rely on the parsing capabilities built in to HTTP::Daemon. This is somewhat clumsy, and definitely over-kill; I only have to do this in cases [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve volunteered to co-maintain the <a href="http://search.cpan.org/dist/HTTP-Parser/">HTTP::Parser</a> CPAN module. I did this because I&#8217;ve been looking for something I can use in <a href="http://search.cpan.org/dist/RPC-XML/lib/RPC/XML/Server.pm">RPC::XML::Server</a> instead of my current approach, which is to rely on the parsing capabilities built in to <a href="http://search.cpan.org/dist/libwww-perl/lib/HTTP/Daemon.pm">HTTP::Daemon</a>. This is somewhat clumsy, and definitely over-kill; I only have to do this in cases where the code is <em>not</em> already running under HTTP::Daemon or Apache. If the code is already using HTTP::Daemon, then it has its own <code>accept()</code> loop it can use, and if the code is running under Apache then the request object has already parsed the headers.</p>
<p>My need comes when the code is not in either of these environments, it has to be able to take the socket it gets from a typical TCP/IP-based <code>accept()</code> and read off the HTTP request. To avoid duplicating code, I trick the socket into thinking that it&#8217;s an instance of HTTP::Daemon::ClientConn, which is itself just a GLOB that&#8217;s been blessed into that namespace for the sake of calling methods. So it works. But it makes the code dependent on having HTTP::Daemon loaded, even when the user is not utilising that class for the daemon functionality of the server. I&#8217;ve needed to drop this for a while, now.</p>
<p>(I&#8217;m not impugning HTTP::Daemon or the <a href="http://search.cpan.org/dist/libwww-perl/">libwww-perl</a> package itself&#8211; both are excellent and I utilise them extensively within this module. But if you are not running your RPC server under HTTP::Daemon, then you probably would prefer to not have that code in memory since you aren&#8217;t really using it.)</p>
<p>Thing is, you can use the request and response objects without having to load the user-agent or daemon classes. But there isn&#8217;t an easy, clean way to use just the header-parsing part of the code by itself. The ClientConn class has a <code>get_request()</code> method that can be instructed to parse only the headers and return the HTTP::Request object without the body filled in. The content of the request can then be read off of the socket/object with sysread(). This is why I use the minor hack that I do.</p>
<p>What I <em>want</em> to do, is be able to do this parsing-out of headers without the ugly hack, without loading all of HTTP::Daemon just so I can call one subroutine (albeit 200+ lines of subroutine). (And to be fair, I also call the <code>read_buffer()</code> routine after the header has been read, to get any content that was already read but not part of the header.) So I came across HTTP::Parser. It has a lot of promise, but it&#8217;s not <em>quite</em> where I need it to be. For one thing, it won&#8217;t stop at just parsing the headers. This is something I need, for cases where the user wants to spool larger elements of a message to disk or for handling compressed content. But most of all, it seemed to not be in active maintenance&#8211; there were two bugs in <a href="http://rt.cpan.org">RT</a> that had been sitting there, with patches provided, for over a year.</p>
<p>Fortunately, an e-mail to the author let me offer to help out, and he accepted. The code was not in any repository, so I set up a repo on GitHub for it <a href="http://github.com/rjray/http-parser">here</a>, and seeded it with the four CPAN releases so that there would be something of a history to fall back on. I&#8217;ve applied the patches (well, applied one, and implemented the other with a better solution) and pushed the changes.</p>
<p>Now, I have to decide how to move forward with this, how to make it as efficient (or more so) than the code in HTTP::Daemon, how to make it into something I can use in RPC::XML::Server to eliminate the unsightly hack I have to rely on currently.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereferenced.com/2009/09/13/parsing-http-headers/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Perl Module Monday: Plack</title>
		<link>http://www.dereferenced.com/2009/09/07/perl-module-monday-plack/</link>
		<comments>http://www.dereferenced.com/2009/09/07/perl-module-monday-plack/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 05:38:45 +0000</pubDate>
		<dc:creator>rjray</dc:creator>
				<category><![CDATA[GitHub]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[module-monday]]></category>

		<guid isPermaLink="false">http://www.dereferenced.com/?p=48</guid>
		<description><![CDATA[This will be a slightly unusual installment of PMM, as I want to look at a module so new that it isn&#8217;t actually on CPAN yet, just GitHub: Plack. (When it makes it to CPAN, it should be here.)
Plack is a reference implementation of the burgeoning PSGI initiative. What is PSGI? Well, if you follow [...]]]></description>
			<content:encoded><![CDATA[<p>This will be a slightly unusual installment of PMM, as I want to look at a module so new that it isn&#8217;t actually on CPAN yet, just <a href="http://github.com/">GitHub</a>: <a href="http://github.com/miyagawa/Plack/tree/master">Plack</a>. (When it makes it to CPAN, it should be <a href="http://search.cpan.org/dist/Plack">here</a>.)</p>
<p>Plack is a reference implementation of the burgeoning <a href="http://github.com/miyagawa/psgi-specs/blob/master/PSGI.pod">PSGI</a> initiative. What is PSGI? Well, if you follow that link you&#8217;ll get a more complete explanation, but the short form is that it is a Perl alternative to Python&#8217;s <a href="http://www.wsgi.org/">WSGI</a> (Web Server Gateway Interface) and Ruby&#8217;s <a href="http://rack.rubyforge.org/">Rack</a>. The longer-form is that it&#8217;s a specification layer to decouple web applications from the specifics of how they&#8217;re being run, whether that&#8217;s CGI, FastCGI, Apache with mod_perl, etc. The longer explanation can be had at the link.</p>
<p>Back to Plack: Plack is the first reference implementation of the PSGI spec, and already it can pass all of the Catalyst tests. And as of <a href="http://github.com/miyagawa/Plack/commit/6c51fb7c27d74fe25d9c460237c0ae664f33a2e7">this commit</a>, the plackup script can coerce a an app written for Catalyst, CGI, etc. into running under different environments, thanks to the magic of PSGI.</p>
<p>I&#8217;ll be watching Plack very closely. I see a PSGI connector for my XML-RPC server in the not-too-distant future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereferenced.com/2009/09/07/perl-module-monday-plack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GreaseMonkey: Hide the ToC on search.cpan.org Module Pages</title>
		<link>http://www.dereferenced.com/2009/07/31/greasemonkey-hide-the-toc-on-search-cpan-org-module-pages/</link>
		<comments>http://www.dereferenced.com/2009/07/31/greasemonkey-hide-the-toc-on-search-cpan-org-module-pages/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 07:29:39 +0000</pubDate>
		<dc:creator>rjray</dc:creator>
				<category><![CDATA[CPAN]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.dereferenced.com/?p=26</guid>
		<description><![CDATA[I love it when tools do exactly what they&#8217;re supposed to, do it effectively, and in doing so let me do things quickly and easily.
Like any serious Perl programmer, I use search.cpan.org several times a day. Indeed, I even have it as a search plug-in for Firefox. But when I am looking at the manual [...]]]></description>
			<content:encoded><![CDATA[<p>I love it when tools do exactly what they&#8217;re supposed to, do it effectively, and in doing so let me do things quickly and easily.</p>
<p>Like any serious Perl programmer, I use <a href="http://search.cpan.org">search.cpan.org</a> several times a day. Indeed, I even have it as a <a href="http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/2e5ad1cb25569ea9/44318577d969b032?lnk=gst">search plug-in for Firefox</a>. But when I am looking at the manual pages for modules, I find the auto-generated table of contents to be cumbersome. I always just scroll past it to get at the meat. Yes, I could click on the links to jump to sections, but then browser-back has to be clicked that many more times to get back to the main distribution page, search results page, etc.</p>
<p>So I did the obvious thing: I set out to write a <a href="http://www.greasespot.net/">GreaseMonkey</a> script to scratch this particular itch. And in this case, JavaScript was just easy-enough to use, and GM just helpful-enough, that before I knew it the task was done. I had initially planned to just put together the basic framework, make sure it was locating the needed <tt>&lt;div&gt;</tt> tags, etc. But that worked right the first time, so I thought I&#8217;d go ahead and have it hide the ToC. That took even less time, so I went ahead and put in a clickable <tt>&lt;span&gt;</tt> tag to toggle the hidden/exposed state of the ToC. And before I realized it, I&#8217;d pretty much finished the whole task.</p>
<p>There were two &#8220;gotchas,&#8221; of sorts, that I had to spend a little time fixing:</p>
<ul>
<li>Seems that you can&#8217;t set the style for CSS pseudo-selectors, &#8220;<tt>:hover</tt>&#8221; in this case, via JavaScript. So I solved this by creating an additional element, a &lt;script&gt; tag, to provide hover-styling for the clickable text.</li>
<li>The <tt>&lt;span&gt;</tt> tag displayed as a block object, and as such the &#8220;hot&#8221; area actually extended well to the right of the text. I solved <em>this</em> part by just wrapping the span in another <tt>&lt;div&gt;</tt>. Then the span was treated as inline, and the &#8220;hot&#8221; part is limited to the bounding-box of the text only.</li>
</ul>
<p>So, the script is being tracked on <a href="http://github.com">GitHub</a>, the project page is <a href="http://github.com/rjray/gm-hide-cpan-toc/tree/master">here</a>. Also, I uploaded it to <a href="http://userscripts.org">userscripts.org</a>, and you can install it from it&#8217;s <a href="http://userscripts.org/scripts/show/54773">page there</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dereferenced.com/2009/07/31/greasemonkey-hide-the-toc-on-search-cpan-org-module-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
