<?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>Andrew Jones&#039; Blog</title>
	<atom:link href="http://blog.andrew-jones.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.andrew-jones.com</link>
	<description>To Get Your Attention Makes Me Smile</description>
	<lastBuildDate>Thu, 03 May 2012 21:14:16 +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>Ruby DuckDuckGo Library 1.1.2 Released</title>
		<link>http://blog.andrew-jones.com/2012/05/03/ruby-duckduckgo-library-1-1-2-released/</link>
		<comments>http://blog.andrew-jones.com/2012/05/03/ruby-duckduckgo-library-1-1-2-released/#comments</comments>
		<pubDate>Thu, 03 May 2012 21:14:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Duck Duck Go]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1165</guid>
		<description><![CDATA[Tonight I pushed out 1.1.2 of my Ruby DuckDuckGo library. It contains a fix for parsing URIs that contain spaces in them and are unescpaed, causing an InvalidURIError. Thanks to Chris Nicola for providing the fix. It can be downloaded &#8230; <a href="http://blog.andrew-jones.com/2012/05/03/ruby-duckduckgo-library-1-1-2-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tonight I pushed out 1.1.2 of my <a href="https://rubygems.org/gems/duck-duck-go" title="Ruby DuckDuckGo library">Ruby DuckDuckGo library</a>. It contains a fix for parsing URIs that contain spaces in them and are unescpaed, causing an <code>InvalidURIError</code>. Thanks to <a href="https://github.com/lucisferre" title="Chris Nicola">Chris Nicola</a> for providing the <a href="https://github.com/andrewrjones/ruby-duck-duck-go/pull/1" title="InvalidURIError fix">fix</a>.</p>
<p>It can be downloaded from <a href="https://rubygems.org/gems/duck-duck-go" title="DuckDuckGo on RubyGems">RubyGems</a> and the source code is on <a href="https://github.com/andrewrjones/ruby-duck-duck-go" title="Ruby DuckDuckGo source code">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/05/03/ruby-duckduckgo-library-1-1-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Over-testing</title>
		<link>http://blog.andrew-jones.com/2012/04/18/over-testing/</link>
		<comments>http://blog.andrew-jones.com/2012/04/18/over-testing/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 18:20:24 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1151</guid>
		<description><![CDATA[Every line of code you write has a cost. It takes time to write it, it takes time to update it, and it takes time to read and understand it. Thus it follows that the benefit derived must be greater &#8230; <a href="http://blog.andrew-jones.com/2012/04/18/over-testing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Every line of code you write has a cost. It takes time to write it, it takes time to update it, and it takes time to read and understand it. Thus it follows that the benefit derived must be greater than the cost to make it. In the case of over-testing, that’s by definition not the case.<br />
<cite><a href="http://37signals.com/svn/posts/3159-testing-like-the-tsa" title="Testing like the TSA">Testing like the TSA by David Heinemeier Hansson</a><br />
</cite>
</p></blockquote>
<p>I&#8217;m definitely guilty of this, and its a hard habit to break.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/04/18/over-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;We need to rename Web 2.0 to HTML5&#8243;</title>
		<link>http://blog.andrew-jones.com/2012/03/14/we-need-to-rename-web-2-0-to-html5/</link>
		<comments>http://blog.andrew-jones.com/2012/03/14/we-need-to-rename-web-2-0-to-html5/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 20:34:19 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1139</guid>
		<description><![CDATA[I actually overheard this somewhere (won&#8217;t say where). We need to rename Web 2.0 to HTML5. Anonymous Buzzword.]]></description>
			<content:encoded><![CDATA[<p>I actually overheard this somewhere (won&#8217;t say where).</p>
<blockquote><p>
We need to rename Web 2.0 to HTML5.<br />
<cite>Anonymous</cite>
</p></blockquote>
<p><a href="http://blog.andrew-jones.com/2011/01/18/html5-the-new-web-2-0/" title="HTML5 – The New Web 2.0">Buzzword</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/03/14/we-need-to-rename-web-2-0-to-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing WebService::TVDB</title>
		<link>http://blog.andrew-jones.com/2012/02/26/introducing-net-tvdb/</link>
		<comments>http://blog.andrew-jones.com/2012/02/26/introducing-net-tvdb/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 23:15:46 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mp4meta]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl-net-tvdb]]></category>
		<category><![CDATA[perl-webservice-tvdb]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1125</guid>
		<description><![CDATA[Note: This module is now called WebService::TVDB, as it&#8217;s a more appropriate namespace. Net::TVDB will be removed from the CPAN. WebService::TVDB is a Perl 5 interface to TheTVDB.com, an open database containing a lot of great information on TV series. &#8230; <a href="http://blog.andrew-jones.com/2012/02/26/introducing-net-tvdb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="alert"><strong>Note:</strong> This module is now called <strong>WebService::TVDB</strong>, as it&#8217;s a more appropriate namespace. Net::TVDB will be removed from the CPAN.</div>
<p><a href="https://metacpan.org/module/WebService::TVDB" title="WebService::TVDB on the CPAN">WebService::TVDB</a> is a Perl 5 interface to <a href="http://thetvdb.com" title="TheTVDB">TheTVDB.com</a>, an open database containing a lot of great information on TV series.</p>
<p>The synopsis shows how to use it:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$tvdb</span> <span style="color: #339933;">=</span> WebService<span style="color: #339933;">::</span><span style="color: #006600;">TVDB</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span>api_key <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'ABC123'</span><span style="color: #339933;">,</span> language <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'English'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$series_list</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$tvdb</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">search</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'men behaving badly'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$series</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$series_list</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># $series is a WebService::TVDB::Series</span>
say <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">SeriesName</span><span style="color: #339933;">;</span>
say <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">overview</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># fetches full series data</span>
<span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetch</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
say <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Rating</span><span style="color: #339933;">;</span>
say <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Status</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$episode</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">episodes</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># $episode is a WebService::TVDB::Episode</span>
  say <span style="color: #0000ff;">$episode</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Overview</span><span style="color: #339933;">;</span>
  say <span style="color: #0000ff;">$episode</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">FirstAired</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$actor</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">actors</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># $actor is a WebService::TVDB::Actor</span>
  say <span style="color: #0000ff;">$actor</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Name</span><span style="color: #339933;">;</span>
  say <span style="color: #0000ff;">$actor</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Role</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$banner</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">$series</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">banners</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># $banner is a WebService::TVDB::Banner</span>
  say <span style="color: #0000ff;">$banner</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">Rating</span><span style="color: #339933;">;</span>
  say <span style="color: #0000ff;">$banner</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">url</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>I am going to use this as an extra source to <a href="https://metacpan.org/module/App::MP4Meta" title="App::MP4Meta in the CPAN">App::MP4Meta</a>. It currently uses the <a href="http://www.imdb.com/" title="IMDB">IMDB</a>, but while its good for films it doesn&#8217;t have as much data on TV series. TheTVDB.com should provide a much better source.</p>
<p>A new version of App::MP4Meta which uses WebService::TVDB should be ready in the next few days.</p>
<h2>Links</h2>
<ul>
<li><a href="https://metacpan.org/module/WebService::TVDB" title="WebService::TVDB on the CPAN">WebService::TVDB on the CPAN</a></li>
<li><a href="https://github.com/andrewrjones/perl5-Net-TVDB" title="WebService::TVDB source on GitHub">WebService::TVDB source on GitHub</a></li>
<li><a href="http://thetvdb.com" title="TheTVDB">TheTVDB.com</a></li>
</ul>
<h2>Related Posts</h2>
<ul>
<li><a href="http://blog.andrew-jones.com/2011/10/10/mp4meta-apply-itunes-like-metadata-to-an-mp4-file/" title="mp4meta – Apply iTunes-like metadata to an mp4 file">mp4meta – Apply iTunes-like metadata to an mp4 file</a></li>
</ul>
<style type="text/css">
div.alert {
color: #3A87AD;
background-color: #D9EDF7;
border-color: #BCE8F1;
padding: 8px 35px 8px 14px;
margin-bottom: 18px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
background-color: #FCF8E3;
border: 1px solid #FBEED5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
</style>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/02/26/introducing-net-tvdb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What Google Thinks of Me</title>
		<link>http://blog.andrew-jones.com/2012/01/28/what-google-thinks-of-me/</link>
		<comments>http://blog.andrew-jones.com/2012/01/28/what-google-thinks-of-me/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 06:36:54 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Privacy]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1115</guid>
		<description><![CDATA[35-44? I still get ID&#8217;d for beer! Also, I am obviously a geek (but I don&#8217;t like Java&#8230;).]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.andrew-jones.com/wp-content/uploads/2012/01/what-google-thinks-of-me.png"><img src="http://blog.andrew-jones.com/wp-content/uploads/2012/01/what-google-thinks-of-me.png" alt="What Google Thinks of Me" title="What Google Thinks of Me" width="658" height="347" class="aligncenter size-full wp-image-1116" /></a></p>
<p>35-44? I still get ID&#8217;d for beer!</p>
<p>Also, I am obviously a geek (but I don&#8217;t like Java&#8230;).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/01/28/what-google-thinks-of-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More than one way to do it</title>
		<link>http://blog.andrew-jones.com/2012/01/24/more-than-one-way-to-do-it/</link>
		<comments>http://blog.andrew-jones.com/2012/01/24/more-than-one-way-to-do-it/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 18:55:44 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1110</guid>
		<description><![CDATA[It was unclear at first how best to give something back to Perl. Fortunately there was more than one way to do it. craigslist Charitable Fund Donates $100,000 to the Perl Foundation]]></description>
			<content:encoded><![CDATA[<blockquote><p>It was unclear at first how best to give something back to Perl. Fortunately there was more than one way to do it.<br />
<cite><a href="http://news.perlfoundation.org/2012/01/craigslist-charitable-fund-don.html" title="craigslist Charitable Fund Donates $100,000 to the Perl Foundation">craigslist Charitable Fund Donates $100,000 to the Perl Foundation</a></cite>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/01/24/more-than-one-way-to-do-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Dist::Zilla Distributions with BuildBot</title>
		<link>http://blog.andrew-jones.com/2012/01/23/building-distzilla-distributions-with-buildbot/</link>
		<comments>http://blog.andrew-jones.com/2012/01/23/building-distzilla-distributions-with-buildbot/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 19:28:20 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Buildbot]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Dist::Zilla]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1037</guid>
		<description><![CDATA[Recently I have been using Buildbot for continuous integration for a number of my open source projects, including some Dist::Zilla based Perl projects (see http://ci.arjones.co.uk/). Buildbot is very customisable, so I have created some custom build steps for Dist::Zilla based &#8230; <a href="http://blog.andrew-jones.com/2012/01/23/building-distzilla-distributions-with-buildbot/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I have been using <a href="http://buildbot.net">Buildbot</a> for <a href="http://en.wikipedia.org/wiki/Continuous_integration">continuous integration</a> for a number of my open source projects, including some <a href="http://dzil.org">Dist::Zilla</a> based Perl projects (see <a href="http://ci.arjones.co.uk/">http://ci.arjones.co.uk/</a>).</p>
<p>Buildbot is very customisable, so I have created some custom build steps for Dist::Zilla based projects. The main benefit is instead of seeing this in your waterfall.</p>
<p><a href="http://blog.andrew-jones.com/wp-content/uploads/2012/01/buildbot-dzil-before.png"><img src="http://blog.andrew-jones.com/wp-content/uploads/2012/01/buildbot-dzil-before.png" alt="Before Dist::Zilla Steps" title="Before Dist::Zilla Steps" width="135" height="154" class="aligncenter size-full wp-image-1078" /></a></p>
<p>You see this.</p>
<p><a href="http://blog.andrew-jones.com/wp-content/uploads/2012/01/buildbot-dzil-after.png"><img src="http://blog.andrew-jones.com/wp-content/uploads/2012/01/buildbot-dzil-after.png" alt="After Dist::Zilla Steps" title="After Dist::Zilla Steps" width="81" height="208" class="aligncenter size-full wp-image-1079" /></a></p>
<p>OK, so not too ground-breaking, but then it wasn&#8217;t a lot of work <img src='http://blog.andrew-jones.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>To use it, first download or clone <a href="https://github.com/andrewrjones/buildbot-dzil-steps">the code</a> and put it somewhere near your buildmaster.</p>
<p>Then, you can use something like the following in your Buildbot configuration file.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> dzil <span style="color: #ff7700;font-weight:bold;">import</span> DzilDependencies, DzilSmoke
&nbsp;
factory.<span style="color: black;">addStep</span><span style="color: black;">&#40;</span>DzilDependencies<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
factory.<span style="color: black;">addStep</span><span style="color: black;">&#40;</span>DzilSmoke<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Currently the following steps are implemented:</p>
<ul>
<li>DzilAuthorDependencies</li>
<li>DzilDependencies</li>
<li>DzilSmoke</li>
<li>DzilTest</li>
</ul>
<p>For more information, see the <a href="https://github.com/andrewrjones/buildbot-dzil-steps">Github page</a>. If you like, you can also see my <a href="https://github.com/andrewrjones/ci.arjones.co.uk-cfg">configuration files</a>, which I will explain in a future post <img src='http://blog.andrew-jones.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/01/23/building-distzilla-distributions-with-buildbot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get all documents from your KinoSearch1 index</title>
		<link>http://blog.andrew-jones.com/2012/01/19/get-all-documents-from-your-kinosearch1-index/</link>
		<comments>http://blog.andrew-jones.com/2012/01/19/get-all-documents-from-your-kinosearch1-index/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 21:18:46 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Kino Search]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1097</guid>
		<description><![CDATA[I wanted a script to dump the entire contents of my KinoSearch1 index into a flat file. Turns out this was pretty easy by using the KinoSearch1::Index::IndexReader. The following Gist shows how I was able to do this. Pretty self-explanatory. &#8230; <a href="http://blog.andrew-jones.com/2012/01/19/get-all-documents-from-your-kinosearch1-index/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted a script to dump the entire contents of my <a href="https://metacpan.org/module/KinoSearch1" title="KinoSearch1 on CPAN">KinoSearch1</a> index into a flat file. Turns out this was pretty easy by using the KinoSearch1::Index::IndexReader.</p>
<p>The following <a href="https://gist.github.com/1640933" title="Code snippet on GitHub">Gist</a> shows how I was able to do this.</p>
<div id="gist-1640933" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c1">#!/usr/bin/perl</span></div><div class='line' id='LC2'><span class="k">use</span> <span class="n">strict</span><span class="p">;</span></div><div class='line' id='LC3'><span class="k">use</span> <span class="n">warnings</span><span class="p">;</span></div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'><span class="k">use</span> <span class="nn">KinoSearch1::Index::</span><span class="n">IndexReader</span><span class="p">;</span></div><div class='line' id='LC6'><br/></div><div class='line' id='LC7'><span class="k">my</span> <span class="nv">$r</span> <span class="o">=</span> <span class="nn">KinoSearch1::Index::</span><span class="n">IndexReader</span><span class="o">-&gt;</span><span class="k">new</span><span class="p">(</span> <span class="n">invindex</span> <span class="o">=&gt;</span> <span class="s">&#39;/path/to/index&#39;</span> <span class="p">);</span></div><div class='line' id='LC8'><br/></div><div class='line' id='LC9'><span class="c1"># get one or more readers</span></div><div class='line' id='LC10'><span class="k">my</span> <span class="nv">@readers</span> <span class="o">=</span> <span class="nb">ref</span> <span class="nv">$r</span><span class="o">-&gt;</span><span class="p">{</span><span class="n">sub_readers</span><span class="p">}</span> <span class="ow">eq</span> <span class="s">&#39;ARRAY&#39;</span> <span class="p">?</span> <span class="nv">@</span><span class="p">{</span> <span class="nv">$r</span><span class="o">-&gt;</span><span class="p">{</span><span class="n">sub_readers</span><span class="p">}</span> <span class="p">}</span> <span class="p">:</span> <span class="nv">$r</span><span class="p">;</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'><span class="k">for</span> <span class="k">my</span> <span class="nv">$reader</span> <span class="p">(</span><span class="nv">@readers</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span> <span class="s">&quot;Segment &quot;</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">.</span> <span class="nv">$reader</span><span class="o">-&gt;</span><span class="n">get_seg_name</span> <span class="o">.</span> <span class="s">&quot; has &quot;</span></div><div class='line' id='LC15'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">.</span> <span class="nv">$reader</span><span class="o">-&gt;</span><span class="n">max_doc</span></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">.</span> <span class="s">&quot; docs\n&quot;</span><span class="p">;</span> </div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1"># the index is numbered from 0 to max_doc, so just loop</span></div><div class='line' id='LC19'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1"># through them and get the documents</span></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span><span class="p">(</span><span class="k">my</span> <span class="nv">$i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nv">$i</span> <span class="o">&lt;</span> <span class="nv">$reader</span><span class="o">-&gt;</span><span class="n">max_doc</span><span class="p">;</span> <span class="nv">$i</span> <span class="o">++</span><span class="p">){</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1"># A KinoSearch1::Document::Doc object</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">my</span> <span class="nv">$doc</span> <span class="o">=</span> <span class="nv">$reader</span><span class="o">-&gt;</span><span class="n">fetch_doc</span><span class="p">(</span><span class="nv">$i</span><span class="p">);</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1"># this will depend on how your index has been set up</span></div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">my</span> <span class="nv">$title</span> <span class="o">=</span> <span class="nv">$doc</span><span class="o">-&gt;</span><span class="n">get_value</span><span class="p">(</span><span class="s">&#39;title&#39;</span><span class="p">);</span></div><div class='line' id='LC26'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">print</span> <span class="s">&quot;$title\n&quot;</span><span class="p">;</span></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC28'><br/></div><div class='line' id='LC29'><span class="p">}</span></div><div class='line' id='LC30'><span class="k">print</span> <span class="s">&quot;Total documents: &quot;</span> <span class="o">.</span> <span class="nv">$r</span><span class="o">-&gt;</span><span class="n">max_doc</span> <span class="o">.</span> <span class="s">&quot; in &quot;</span> <span class="o">.</span> <span class="nv">@readers</span> <span class="o">.</span> <span class="s">&quot; segments\n&quot;</span><span class="p">;</span> </div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1640933/922d42acbe1f8f802ca096a1852548afb6b59447/kinosearch1_dump.pl" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1640933#file_kinosearch1_dump.pl" style="float:right;margin-right:10px;color:#666">kinosearch1_dump.pl</a>
            <a href="https://gist.github.com/1640933">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>Pretty self-explanatory. Let me know if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/01/19/get-all-documents-from-your-kinosearch1-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ant Task to generate an XML Sitemap</title>
		<link>http://blog.andrew-jones.com/2012/01/15/ant-task-to-generate-an-xml-sitemap/</link>
		<comments>http://blog.andrew-jones.com/2012/01/15/ant-task-to-generate-an-xml-sitemap/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 22:02:06 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1085</guid>
		<description><![CDATA[I use Ant for more than just Java projects, including building my own website. So I have written an Ant task to generate an XML Sitemap and released the first version. Here is an example of using the task: &#60;target &#8230; <a href="http://blog.andrew-jones.com/2012/01/15/ant-task-to-generate-an-xml-sitemap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://ant.apache.org/">Ant</a> for more than just Java projects, including building <a href="http://andrew-jones.com">my own website</a>. So I have written an Ant task to generate an <a href="http://en.wikipedia.org/wiki/Sitemaps" title="Sitemap on Wikipedia">XML Sitemap</a> and released the first version.</p>
<p>Here is an example of using the task:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;generate_sitemap&quot;</span> <span style="color: #000066;">description</span>=<span style="color: #ff0000;">&quot;generates the sitemap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sitemap&quot;</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;uk.co.arjones.ant.task.Sitemap&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sitemap</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;http://andrew-jones.com&quot;</span> <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span> <span style="color: #000066;">lastmod</span>=<span style="color: #ff0000;">&quot;now&quot;</span> <span style="color: #000066;">gzip</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${BUILD_DIR}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**.htm&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**.html&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exclude</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;google*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sitemap<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Its pretty self-explanatory. For more information and to download it, go to the <a href="https://github.com/andrewrjones/ant-task-sitemap" title="ant-task-sitemap on GitHub">project page on GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/01/15/ant-task-to-generate-an-xml-sitemap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl, Wildcards and the Windows Command Line</title>
		<link>http://blog.andrew-jones.com/2012/01/12/perl-wildcards-and-the-windows-command-line/</link>
		<comments>http://blog.andrew-jones.com/2012/01/12/perl-wildcards-and-the-windows-command-line/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 06:35:33 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[MS Windows]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://blog.andrew-jones.com/?p=1036</guid>
		<description><![CDATA[When developing for multiple platforms, its always the little things that catch you out. Heres one example I found while developing gcal, a Command Line Interface to Google Calendar. On Unix (including Mac OS X shells) wildcard expansion is done &#8230; <a href="http://blog.andrew-jones.com/2012/01/12/perl-wildcards-and-the-windows-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When developing for multiple platforms, its always the little things that catch you out.</p>
<p>Heres one example I found while developing <code><a href="http://blog.andrew-jones.com/2011/11/27/gcal-a-command-line-interface-to-google-calendar/" title="gcal – A Command Line Interface to Google Calendar">gcal</a></code>, a Command Line Interface to <a href="http://www.google.com/calendar">Google Calendar</a>. On Unix (including Mac OS X shells) wildcard expansion is done by the shell, and then the expanded list of files is passed on to the program being run. On Windows, the shell doesn&#8217;t do any expansion, and it&#8217;s up to programs to do the expansion<sup>[<a href="http://blog.andrew-jones.com/2012/01/12/perl-wildcards-and-the-windows-command-line/#footnote_0_1036" id="identifier_0_1036" class="footnote-link footnote-identifier-link" title="The difference in wildcard expansion between Windows and unix/Macintosh">1</a>]</sup>.</p>
<p>To get around this in Perl, you can do something like this<sup>[<a href="http://blog.andrew-jones.com/2012/01/12/perl-wildcards-and-the-windows-command-line/#footnote_1_1036" id="identifier_1_1036" class="footnote-link footnote-identifier-link" title="How can I handle wildcards on the command line using Perl on Windows? - Stack Overflow">2</a>]</sup>.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@args</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$^O</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">'MSWin32'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #000066;">map</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066;">glob</span> <span style="color: #009900;">&#125;</span> <span style="color: #339933;">@</span><span style="color: #000000; font-weight: bold;">ARGV</span> <span style="color: #339933;">:</span> <span style="color: #339933;">@</span><span style="color: #000000; font-weight: bold;">ARGV</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here we are passing all the arguments to <code><a href="http://perldoc.perl.org/functions/glob.html" title="Perl glob">glob</a></code>, which will do the shell expansions, including wildcards. We only want to do this for Windows, as if you use it on Unix you risk globbing real file names &#8211; asterisks and question marks are valid characters in Unix file names.</p>
<h2>Related Posts</h2>
<ul>
<li><a href="http://blog.andrew-jones.com/2011/11/27/gcal-a-command-line-interface-to-google-calendar/" title="gcal – A Command Line Interface to Google Calendar">gcal &#8211; A Command Line Interface to Google Calendar</a></li>
</ul>
<h2>References</h2>
<ol class="footnotes">
<li id="footnote_0_1036" class="footnote"><a href="http://blogs.msdn.com/b/dancre/archive/2005/05/14/417547.aspx" title="The difference in wildcard expansion between Windows and unix/Macintosh">The difference in wildcard expansion between Windows and unix/Macintosh</a></li>
<li id="footnote_1_1036" class="footnote"><a href="http://stackoverflow.com/questions/1125895/how-can-i-handle-wildcards-on-the-command-line-using-perl-on-windows" title="How can I handle wildcards on the command line using Perl on Windows? - Stack Overflow">How can I handle wildcards on the command line using Perl on Windows? &#8211; Stack Overflow</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.andrew-jones.com/2012/01/12/perl-wildcards-and-the-windows-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

