<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>noop();</title>
    <link>http://blog.mombe.org</link>
    <description>noop(&quot;guy's blog&quot;);</description>
    <language>en</language>
    <ttl>3600</ttl>
    <generator>blosxom/2.0</generator>


<item>
  <title>ATOM to KML converter</title>
  <link>http://blog.mombe.org/systems/atomtokml.htm</link>
  <description>&lt;p&gt;
A &lt;a href=&quot;http://jamesstapley.com&quot;&gt;friend&lt;/a&gt; of mine is currently on a &lt;a
href=&quot;http://www.asclme.org/the-asclme-project/research-cruises/2008-cruise.html&quot;&gt;research
cruise&lt;/a&gt; and has been &lt;a
href=&quot;http://www.asclme.org/lang-en/the-asclme-project/research-cruises/2008-cruise/cruise-blog.html?&quot;&gt;blogging&lt;/a&gt;
along the way.  Each time he blogs, he posts a position update in the form
of a link to &lt;a href=&quot;http://maps.google.com/&quot;&gt;Google Maps&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
It occurred to me that it'd be nice to have a real-time route map of where
he'd been, and that a &lt;a href=&quot;http://www.blog.asclme.org/map/&quot;&gt;Google maps
mashup&lt;/a&gt; would be a good way to do this.  The problem was getting the data
to create the mashup.  His blog includes an &lt;a
href=&quot;http://en.wikipedia.org/wiki/Atom_(standard)&quot;&gt;Atom Syndication
Format&lt;/a&gt; feed for syndication, so I figured that what I needed was a way
to automatically convert this data into something Google maps could
understand.
&lt;/p&gt;

&lt;p&gt;
I've been playing a fair amount with Google's &lt;a
href=&quot;http://en.wikipedia.org/wiki/Keyhole_Markup_Language&quot;&gt;Keyhole Markup
Language&lt;/a&gt; (KML) for work reasons &amp;mdash; we use it to record GIS data
about our network infrastructure for use in &lt;a
href=&quot;http://earth.google.com/&quot;&gt;Google Earth&lt;/a&gt;.  KML works nicely in Maps
too, so it seemed that what I really needed was a way to take ATOM data from
a blog and convert it to KML.
&lt;/p&gt;

&lt;p&gt;
A little bit of PHP later and I had what I needed.  A script that read the
ATOM, extracted position information from it, and converted that into a KML
script I could use in my &lt;a
href=&quot;http://www.blog.asclme.org/map/&quot;&gt;mashup&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Figuring that this would probably be useful to someone else, I've tried to
make my ATOM to KML converter as generic as possible.  I knows nothing of
the particular blog, and extracts everything it needs to know from the blog
itself.
&lt;/p&gt;

&lt;p&gt;
The result is available as &lt;a
href=&quot;/data/systems/patches/atomtokml-php.asis&quot;&gt;atomtokml.php&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
You'll need &lt;a href=&quot;http://httpd.apache.org/&quot;&gt;Apache&lt;/a&gt; and &lt;a
href=&quot;http://php.net/&quot;&gt;PHP&lt;/a&gt; (with the XML, PREG and cURL extensions), as
well as the &lt;a href=&quot;http://simplepie/&quot;&gt;SimplePie&lt;/a&gt; ATOM PHP class.  The
latter is &lt;tt&gt;simplepie.inc&lt;/tt&gt; and need to go somewhere in PHP's search
path.
&lt;/p&gt;

&lt;p&gt;
Configuration is easy or non-existent.  There are a couple of variables at
the top of the &lt;tt&gt;atomtokml.php&lt;/tt&gt; script that you may need to set.
&lt;/p&gt;

&lt;p&gt;
To use it, simply call it from a web browser.  By default it'll probably
open in in Google Earth.  You can also use the &lt;a
href=&quot;http://code.google.com/apis/maps/documentation/reference.html#GGeoXml&quot;&gt;GGeoXml&lt;/a&gt;
function to load it in a Maps mashup.
&lt;/p&gt;

&lt;p&gt;
The script understands a few parameters to make life easier. 
&lt;tt&gt;nocache=1&lt;/tt&gt; will disable SimplePie's ATOM cache and fetch the feed
directly from source again &amp;mdash; useful for forcing a reload. 
&lt;tt&gt;text=1&lt;/tt&gt; will display the resulting KML as &lt;em&gt;text/plain&lt;/em&gt; rather
than &lt;em&gt;application/vnd.google-earth.kml+xml&lt;/em&gt;, which will probably make
it display in your browser &amp;mdash; useful for finding out why a post didn't
make it into the KML.  Finally, &lt;tt&gt;feed=&lt;em&gt;URL&lt;/em&gt;&lt;/tt&gt; will override the
default feed URL and fetch a different ATOM feed &amp;mdash; this'll let you use
the same script for multiple blogs.
&lt;/p&gt;

&lt;p&gt;
From a blogger's perspective, there are two ways to get a post into the KML. 
The first is to make sure your ATOM feed has the longitude &amp;amp; latitude
fields set for each post.  Realising that most blogging software doesn't
support this, the second is to post links to &lt;a
href=&quot;http://maps.google.com/&quot;&gt;Google Maps&lt;/a&gt; in entries you want to
appear.  The script can parse Google Maps' permalink format and extract
longitude &amp;amp; latitude from the URL.
&lt;/p&gt;

&lt;p&gt;
As usual, YMMMV.
&lt;/p&gt;&lt;p&gt;&lt;a name=&quot;atomtokml-1&quot; class=&quot;updatetitle&quot;&gt;UPDATE 2008/08/31: bug fixes
&lt;/a&gt;&lt;br /&gt;I've updated &lt;a
href=&quot;/data/systems/patches/atomtokml-php.asis&quot;&gt;atomtokml.php&lt;/a&gt; to fix a
few bugs in the KML output (it seems I didn't read the &lt;a
href=&quot;http://code.google.com/apis/kml/documentation/kmlreference.html&quot;&gt;spec&lt;/a&gt;
properly).  The output now validates correctly in a couple of different &lt;a
href=&quot;http://feedvalidator.org/&quot;&gt;KML validators&lt;/a&gt;.  Unfortunately it
seems that, having done this, Google Earth doesn't parse a KML 2.2. file
properly :) It'll load fine, but if you turn verbose warnings on, you'll get
warned about some of the imported &lt;atom:*&gt; elements.
&lt;/p&gt;

</description>
  <author>Guy Antony Halse</author>
  <pubDate>Fri, 29 Aug 2008 07:55:00 +0200</pubDate>
</item>

<item>
  <title>Building Mozilla Weave on FreeBSD</title>
  <link>http://blog.mombe.org/systems/weave-freebsd.htm</link>
  <description>
&lt;p&gt;
Mozilla Lab's &lt;a href=&quot;http://labs.mozilla.com/projects/weave/&quot;&gt;Weave&lt;/a&gt;
project provides bookmark and user data synchronisation between browsers. 
It's very useful, but doesn't currently support FreeBSD.  Since I run &lt;a
href=&quot;http://mozilla.com/firefox&quot;&gt;Firefox 3.0&lt;/a&gt; on FreeBSD, this is a
little irritating to me ;) So, following the hints on Weave's wiki, I
attempted to &lt;a href=&quot;http://wiki.mozilla.org/Labs/Weave/Building&quot;&gt;build&lt;/a&gt;
Weave on my BSD box.
&lt;/p&gt;

&lt;p&gt;
The script I came up with is a nasty hack.  There *must* be a cleaner way to
do this.  Nevertheless, it successfully builds Weave 0.2.5 on FreeBSD
7.0-RELEASE against the Firefox 3.0.1 sources.
&lt;/p&gt;

&lt;p&gt;
To build Weave, you'll need a working ports system that's reasonably
up-to-date (has &lt;a
href=&quot;http://freshports.org/www/firefox3&quot;&gt;www/firefox3&lt;/a&gt;).  You'll also
need gmake and python installed.
&lt;/p&gt;

&lt;p&gt;
Download the latest &lt;a
href=&quot;http://hg.mozilla.org/labs/weave/index.cgi/archive/tip.tar.gz&quot;&gt;Weave
sources&lt;/a&gt; and untar them.  Then copy my &lt;a
href=&quot;/data/systems/patches/buildweave.sh.asis&quot;&gt;script&lt;/a&gt; into the
top-level source directory (weave-c8bce0724360 at time of writing).  cd into
this directory, and run the &lt;a
href=&quot;/data/systems/patches/buildweave.sh.asis&quot;&gt;buildweave.sh&lt;/a&gt; script. 
You'll be left with an XPI installer ready to install.
&lt;/p&gt;

&lt;p&gt;
For those who're lazy, here's my &lt;a
href=&quot;/data/systems/patches/weave-FreeBSD.xpi.asis&quot;&gt;pre-compiled version of
Weave 0.2.5&lt;/a&gt; for FreeBSD 7.0.
&lt;/p&gt;&lt;p&gt;&lt;a name=&quot;weave-freebsd-1&quot; class=&quot;updatetitle&quot;&gt;UPDATE 2008/08/10: Weave 0.2.6 released
&lt;/a&gt;&lt;br /&gt;Weave's been updated, so here's a &lt;a href=&quot;/data/systems/patches/weave-FreeBSD.xpi-0.2.6.asis&quot;&gt;pre-compiled version of 0.2.6&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;&lt;a name=&quot;weave-freebsd-2&quot; class=&quot;updatetitle&quot;&gt;UPDATE 2008/10/20: Weave 0.2.7 released
&lt;/a&gt;&lt;br /&gt;Weave's been updated, so here's a &lt;a href=&quot;/data/systems/patches/weave-FreeBSD-0.2.7.xpi.asis&quot;&gt;pre-compiled version of 0.2.7&lt;/a&gt;.
&lt;/p&gt;

</description>
  <author>Guy Antony Halse</author>
  <pubDate>Mon, 21 Jul 2008 18:22:00 +0200</pubDate>
</item>

<item>
  <title>EPrints, SPAM &amp;amp; deleting users</title>
  <link>http://blog.mombe.org/systems/eprints.htm</link>
  <description>
&lt;p&gt;
We run an instance of &lt;a href=&quot;http://eprints.org/&quot;&gt;EPrints 2.3&lt;/a&gt; and
noticed recently that it was getting lots of SPAM.  Well, more specifically,
that a lot of spammers had registered accounts on the system with meaningful
usernames like &amp;quot;cunnilingus&amp;quot;.  Fortunately our self-archiving
policy requires that user submissions are approved, but nevertheless the
multitude of irrelevent accounts was irritating.
&lt;/p&gt;

&lt;p&gt;
It was then that I discovered that EPrints doesn't have a command-line way
to delete users.  There's a &lt;tt&gt;create_user&lt;/tt&gt;, but no
&lt;tt&gt;remove_user&lt;/tt&gt;.  Not being one who is daunted by such problems, I set
about writing one.  It turned out to be quite simple.
&lt;/p&gt;

&lt;p&gt;
Since I'm a firm believer of making the wheel available, here's what &lt;a
href=&quot;/data/systems/patches/remove_user.asis&quot;&gt;I came up with&lt;/a&gt;.  YMMV and all that.
&lt;/p&gt;</description>
  <author>Guy Antony Halse</author>
  <pubDate>Thu, 29 May 2008 09:04:00 +0200</pubDate>
</item>

  </channel>
</rss>
