<?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>Robin Clarke - Perl and Life &#187; Internet</title>
	<atom:link href="http://www.robinclarke.net/archives/category/internet/feed" rel="self" type="application/rss+xml" />
	<link>http://www.robinclarke.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:07:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Perl interface to Google Directions API</title>
		<link>http://www.robinclarke.net/archives/perl-interface-to-google-directions-api</link>
		<comments>http://www.robinclarke.net/archives/perl-interface-to-google-directions-api#comments</comments>
		<pubDate>Wed, 01 Feb 2012 19:55:50 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[Ironman]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[directions]]></category>
		<category><![CDATA[ironman]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=664</guid>
		<description><![CDATA[Google has a pretty neat service for getting driving/cycling/walking directions between places, and now there&#8217;s a perl interface to it: Google::Directions (and on GitHub) It&#8217;s Moosey and it&#8217;s juicy&#8230; I hope it helps you get from A to B with Perl a bit faster! If anybody is top-fit with Moose::Util::TypeConstraints, I have some issues in this module [...]]]></description>
			<content:encoded><![CDATA[<p>Google has a pretty neat service for getting driving/cycling/walking directions between places, and now there&#8217;s a perl interface to it: <a title="Google::Directions" href="http://search.cpan.org/perldoc?Google::Directions" target="_blank">Google::Directions</a> (and on <a title="Google::Directions on GitHub" href="https://github.com/robin13/Google-Directions" target="_blank">GitHub</a>)</p>
<p>It&#8217;s Moosey and it&#8217;s juicy&#8230; I hope it helps you get from A to B with Perl a bit faster! <img src='http://www.robinclarke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If anybody is top-fit with Moose::Util::TypeConstraints, I have some issues in this module which I don&#8217;t understand and would really appreciate some tips with. <img src='http://www.robinclarke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And here&#8217;s some sample code:</p>
<pre>#!/usr/bin/env perl</pre>
<pre>use strict;
use warnings;
use Google::Directions::Client;
use Getopt::Long;</pre>
<pre>my %params;
GetOptions( \%params,
 'origin=s',
 'destination=s',
 );</pre>
<pre>my $goog = Google::Directions::Client-&gt;new();</pre>
<pre>my $response = $goog-&gt;directions( %params );
my $first_leg = $response-&gt;routes-&gt;[0]-&gt;legs-&gt;[0];
printf( "That journey will take you %0.1f minutes and %0.1fkm\n",
 ( $first_leg-&gt;duration / 60 ),
 ( $first_leg-&gt;distance / 1000 ),
 );</pre>
<pre># $&gt; ./test_directions.pl --origin "Munich, Germany" --destination "Hamburg, Germany"</pre>
<pre># That journey will take you 443.8 minutes and 778.5km</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/perl-interface-to-google-directions-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying transit times on a map (Munich/MVV)</title>
		<link>http://www.robinclarke.net/archives/displaying-transit-times-on-a-map-munichmvv</link>
		<comments>http://www.robinclarke.net/archives/displaying-transit-times-on-a-map-munichmvv#comments</comments>
		<pubDate>Wed, 30 Nov 2011 17:04:11 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Ironman]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=580</guid>
		<description><![CDATA[A personal (but techy) project I&#8217;ve been doing on the side recently has just reached a milestone. Some time in the next year we are going to move out of the city centre.  I want to live as far away from the concrete jungle, rumbling juggernauts and grumpy people as I can, but&#8230; it would [...]]]></description>
			<content:encoded><![CDATA[<p>A personal (but techy) project I&#8217;ve been doing on the side recently has just reached a milestone.<br />
Some time in the next year we are going to move out of the city centre.  I want to live as far away from the concrete jungle, rumbling juggernauts and grumpy people as I can, but&#8230; it would be nice not to be too far away from friends, activities and shopping&#8230;.</p>
<p>There are many parameters involved (and in time I will put them all on a map!), but probably the most important one is that our new home <strong>must be within a reasonable transit time by public transport of the city centre</strong>.  But reasonable is relative&#8230; if the new place is great it could be 40 minutes, for &#8220;ok&#8221; it would have to be less than 30, and &#8220;fantastic&#8221; might get us to stretch to 50 minutes.  The trips shouldn&#8217;t have a frequency (during the day) of more than 20 minutes either, otherwise we&#8217;d always be missing/waiting for a train&#8230;</p>
<p>So how can I visualise these regions on a map?</p>
<ol>
<li>Write an interface to the <a title="MVV" href="http://www.mvv-muenchen.de/" target="_blank">MVV</a> (the public transport provider in Munich) web interface.  Unfortunately they don&#8217;t have a documented API, but they do have a RESTful interface, and a <a title="Public Transport Enabler" href="http://code.google.com/p/public-transport-enabler/">Java interface</a> already exists (thanks <a title="Oeffi" href="https://market.android.com/details?id=de.schildbach.oeffi">Andreas</a>!).  Between that and some further reverse engineering it wasn&#8217;t too difficult.  I&#8217;ll be publishing that module soon too. <img src='http://www.robinclarke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Localise all the stops in the region, and determine the transit times, and frequencies from the central station (Munich Hauptbahnhof) to each of the stops.  Throw all that data into a database for easy access. (<a title="SQLite" href="http://www.sqlite.org/">SQLite</a> is your friend).</li>
<li>Write a <a title="Google::Fusion" href="http://search.cpan.org/search?query=Google%3A%3AFusion&amp;mode=all" target="_blank">Perl interface</a> to <a title="Fusion Tables" href="http://www.google.com/fusiontables/Home/" target="_blank">Google Fusion Tables</a> (there are <a title="PHP/Python interfaces to Fusion tables" href="http://code.google.com/apis/fusiontables/docs/sample_code.html">interfaces in Python and PHP</a> already, but I prefer Perl&#8230;).</li>
<li>Analyse the data, generate polygons around each stop indicating the distance you could walk (assuming 4kmh average walking speed) from that stop after having travelled from the central station, within a time limit (10 minutes, 20 minutes, &#8230;)</li>
<li>Convert the polygons to <a title="KML reference" href="http://code.google.com/apis/kml/documentation/kmlreference.html" target="_blank">KML</a> (that&#8217;s an XML variant which google uses for representing geographic data).</li>
<li>Upload the polygons to Fusion tables</li>
<li>Do some tweaking with the colouring so that the data is visually appealing and understandable.</li>
</ol>
<div>The result is pretty, colourful, zoomable, responsive, and more importantly: shows me exactly what I want to see in a way which numbers in a table never could have: (click <a href="https://www.google.com/fusiontables/embedviz?viz=MAP&amp;q=select+col1+from+2304677+&amp;h=false&amp;lat=48.19187395469069&amp;lng=11.499547000000007&amp;z=10&amp;t=1&amp;l=col1" target="_blank">here to pop-out</a>)</div>
<p><iframe src="https://www.google.com/fusiontables/embedviz?viz=MAP&#038;q=select+col1+from+2304677+&#038;h=false&#038;lat=48.19187395469069&#038;lng=11.499547000000007&#038;z=10&#038;t=1&#038;l=col1" scrolling="no" width="600px" height="400px"></iframe></p>
<p>For my next party trick I&#8217;ll be putting proximity to shopping centres, parks on the map, and possibly doing the same representation for transit time with a car.  Any other ideas what would be relevant, and pretty on the map?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/displaying-transit-times-on-a-map-munichmvv/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl for Fusion Tables</title>
		<link>http://www.robinclarke.net/archives/perl-for-fusion-tables</link>
		<comments>http://www.robinclarke.net/archives/perl-for-fusion-tables#comments</comments>
		<pubDate>Sat, 17 Sep 2011 15:31:41 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Ironman]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[fusion]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[ironman]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=531</guid>
		<description><![CDATA[The last couple of weeks I&#8217;ve been getting accustomed to Google Fusion Tables. For those who haven&#8217;t yet noticed it &#8211; Fusion Tables is a new (still in Beta) Google product for data storage: a kind of database. Some major cool things about Fusion Tables: it&#8217;s really accessible (use the usual OAuth2 authentication as for [...]]]></description>
			<content:encoded><![CDATA[<p>The last couple of weeks I&#8217;ve been getting accustomed to Google Fusion Tables.</p>
<p>For those who haven&#8217;t yet noticed it &#8211; Fusion Tables is a new (still in Beta) Google product for data storage: a kind of database.</p>
<p>Some major cool things about Fusion Tables:</p>
<ol>
<li>it&#8217;s really accessible (use the usual OAuth2 authentication as for all other Google services to script interaction), or use the web interface to manually edit your tables.</li>
<li>If you include geo data in your tables, you can easily (and I mean <em>really</em> easily!) display your data on a map.</li>
<li>They&#8217;re really clever about geo data&#8230; a text address, longitude/latitude, polygons, shapes, &#8230; dump it into a &#8220;Location&#8221; type field, and it will probably be understood.</li>
</ol>
<div>The one annoying thing: being in Beta, there aren&#8217;t many tools available to work with it yet&#8230;  But as usual: if someone else hasn&#8217;t done it, you&#8217;d better do it yourself:</div>
<div>
<ul>
<li><a title="Google::Fusion" href="https://github.com/robin13/Google-Fusion" target="_blank">Google::Fusion</a> - an object oriented (perl) interface to Google::Fusion tables</li>
<li><a title="Net::OAuth2" href="https://github.com/robin13/Net-OAuth2" target="_blank">Net::OAuth2</a> - the authentication module</li>
</ul>
</div>
<p>Net::OAuth2 isn&#8217;t actually a new Perl module, but in its previous state it wasn&#8217;t really usable for command line applications, so I reworked it a bit.  Both of these modules are very raw/alpha &#8211; they are lacking in documentation, error handling, unit tests&#8230;. all the things one would expect in productive code&#8230; but I want to get them out there <strong><em>now</em></strong> so other people can start using and abusing them.</p>
<p>Here&#8217;s a wee screencast of <a title="pfusion" href="https://github.com/robin13/Google-Fusion/blob/master/bin/pfusion" target="_blank">pfusion</a> in action:</p>
<div><iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="344" src="http://www.youtube.com/embed/b-m2dtoZcOM" frameborder="0" allowFullScreen="true"> </iframe></div>
<p>And a short instruction to install (I hope it&#8217;s complete&#8230;):</p>
<pre>git clone git://github.com/robin13/Net-OAuth2.git
git clone git://github.com/robin13/Google-Fusion.git
vi ~/.fusion</pre>
<p>Edit to look like this, with the id/secret of your application.  If you haven&#8217;t got an id/secret yet, you&#8217;ll have to register an application for this purpose on the <a title="Google API Console" href="https://code.google.com/apis/console/b/0/" target="_blank">Google API Console</a> and be sure to make it an &#8220;installed application&#8221; (not &#8220;web application&#8221;)</p>
<pre>---
client_id: 372296649547.apps.googleusercontent.com
client_secret: XDy8Y8xTuwN90F3h7ljCuw4i</pre>
<p># And now run fusion:</p>
<pre>perl -I ./Google-Fusion/lib -I ./Net-OAuth2/lib ./Google-Fusion/bin/pfusion</pre>
<p>If authentication is successful, you should be able to interact with Fusion Tables to your hearts content, and should find a .fusion.auth file in your home directory with your current tokens (you only have to enter the authentication code the first time).</p>
<p>I hope you have fun with it, and give me some nice pull requests on those repositories!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/perl-for-fusion-tables/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MediathekP &#8211; Deutsches Fernsehen mit Perl gucken</title>
		<link>http://www.robinclarke.net/archives/mediathekp-deutsches-fernsehen-mit-perl-gucken</link>
		<comments>http://www.robinclarke.net/archives/mediathekp-deutsches-fernsehen-mit-perl-gucken#comments</comments>
		<pubDate>Mon, 29 Nov 2010 17:00:41 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl ironman mediathek video flvstreamer]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=426</guid>
		<description><![CDATA[Diese Woche veroeffentliche ich eine Anwendung zum runterladen von Oeffentliche Deutsche Sendungen.  Eigentlich ist das einen Perl Clone von Mediathek, und das meiste Arbeit (scrapping der Seiten nach den media URLs) wird auch von dieser Projekt gemacht, und als XML stuendlich zur Verfuegung gestellt. MediathekP habe ich ein bischen anders als das Original verarbeitet.  Das [...]]]></description>
			<content:encoded><![CDATA[<p>Diese Woche veroeffentliche ich eine Anwendung zum runterladen von Oeffentliche Deutsche Sendungen.  Eigentlich ist das einen Perl Clone von <a title="Mediathek" href="http://zdfmediathk.sourceforge.net/" target="_blank">Mediathek</a>, und das meiste Arbeit (scrapping der Seiten nach den media URLs) wird auch von dieser Projekt gemacht, und als XML stuendlich zur Verfuegung gestellt.</p>
<p>MediathekP habe ich ein bischen anders als das Original verarbeitet.  Das XML (meistens &gt;20MB) tuhe ich erstmal mit XML::Twig parsen und in ein SQLite datenbank lesen.  Das kann zwar erstmal etwas laenger dauern als der reine rein-saugen und darstellen wie es der Java Geschwister macht, aber auch ein PC mit sehr wenig Speicher uebrig kann das hinbekommen, und nachdem die Daten im Datenbank sind, sind Abfragen auch viel schneller und einfacher.  Das von mir letzte Woche veroeffentlichte Modul <a title="Video::Flvstreamer" href="http://search.cpan.org/~rcl/Video--Flvstreamer/lib/Video/Flvstreamer.pm" target="_blank">Video::Flvstreamer</a> verwendet <a title="Flvstreamer" href="http://savannah.nongnu.org/projects/flvstreamer" target="_blank">flvstreamer</a> &#8211; ein RTMP streaming client um dann die Videos lokal zu speichern.</p>
<p>Eine kurze Anleitung:</p>
<blockquote>
<pre>git clone git://github.com/robin13/mediathekp.git
cd mediathekp
./mediathek.pl --cache_dir /path/to/cache --action refresh_media
./mediathek.pl --cache_dir /path/to/cache --action list
./mediathek.pl --cache_dir /path/to/cache --target_dir /path/to/target --action download --id 123</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/mediathekp-deutsches-fernsehen-mit-perl-gucken/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New perl module: Video::Flvstreamer</title>
		<link>http://www.robinclarke.net/archives/new-perl-module-videoflvstreamer</link>
		<comments>http://www.robinclarke.net/archives/new-perl-module-videoflvstreamer#comments</comments>
		<pubDate>Mon, 22 Nov 2010 06:41:01 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Perl cpan video flvstreamer]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=414</guid>
		<description><![CDATA[I&#8217;ve just published a new module: Video::Flvstreamer. It&#8217;s a pretty simple wrapper around the command line application flvstreamer.  Flvstreamer is a handy tool to record video streams and save the video data as a video file you can play with your favourite video player.  There are many websites which have great streaming video content, but [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just published a new module: <a title="Video::Flvstreamer" href="http://search.cpan.org/~rcl/Video--Flvstreamer-0.1/lib/Video/Flvstreamer.pm" target="_blank">Video::Flvstreamer</a>.</p>
<p>It&#8217;s a pretty simple wrapper around the command line application <a title="Flvstreamer" href="http://savannah.nongnu.org/projects/flvstreamer" target="_blank">flvstreamer</a>.  Flvstreamer is a handy tool to record video streams and save the video data as a video file you can play with your favourite video player.  There are many websites which have great streaming video content, but if you don&#8217;t like watching the video in your browser, or might want to watch it later, you can now use flvstreamer to capture the video.</p>
<p>Video::Flvstreamer can be used to integrate flvstreamer into Perl applications (here getting &#8220;Mit Offenen Karten&#8221; from Arte):</p>
<pre style="padding-left: 30px;">my $url = "rtmp://artestras.fcod.llnwd.net/a3903/o35/MP4:geo/videothek/EUR_DE_FR/arteprod/A7_SGT_ENC_04_043742-007-A_PG_HQ_DE?h=97599a8731270956b946df58bb6b6b95";
my $target = "/tmp/Mit_Offenen_Karten.flv";
my $flv = Video::Flvstreamer-&gt;new();
$flv-&gt;get( $url, $target );
</pre>
<p>I&#8217;m currently working on a Perl clone of <a title="Mediathek" href="http://zdfmediathk.sourceforge.net/" target="_blank">Mediathek</a> &#8211; a Java application for downloading German public TV shows: Video::Flvstreamer is an integral part of that application.</p>
<p>Video::Flvstreamer has one neat feature improvement on the command line: you can specify the number of times it should try to resume downloading.  Connections for downloading a stream can often be disconnected&#8230; Now that&#8217;s less of a bother! <img src='http://www.robinclarke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/new-perl-module-videoflvstreamer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

