Devlog :: And Wizardry

Thu, 01 Oct 2009

Speaking of Perl modules that work -> Net::PubSubHubbub::Publisher

The other day I mentioned that I was looking at [PubSubHubbub http://code.google.com/p/pubsubhubbub/] (PuSH). I was inspired by this post on [Rogers Cadenhead's workbench http://workbench.cadenhead.org/news/3560/pubsubhubbub-lot-easier-than-sounds]. Rogers lays PuSH publishing out in a few steps. Basically, add some XML to your RSS feed and ping a hub when you publish. I made the needed changes to my blosxom 2.1.1 cgi code, down near the end: /rss head <?xml version="1.0" encoding="$blog_encoding"?>/ */rss head <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">/* /rss head <channel>/ /rss head <title>$blog_title</title>/ */rss head <atom:link href="http://pwizardry.com/devlog/index.cgi/index.rss" rel="self" type="application/rss+xml" />/* */rss head <atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />/* (*Bold* lines are the inserted changes.) Then I installed the Perl module [Net::PubSubHubbub::Publisher http://search.cpan.org/~bradfitz/Net-PubSubHubbub-Publisher-0.91/] and hacked together this quick program: /#! /usr/bin/perl/ /use Net::PubSubHubbub::Publisher;/ /use strict;/ /use warnings;/ /my $hub = "http://pubsubhubbub.appspot.com";/ /my $topic_url = "http://pwizardry.com/devlog/index.cgi/index.rss";/ /my $pub = Net::PubSubHubbub::Publisher->new( hub => $hub);/ /$pub->publish_update( $topic_url ) or die "Ping failed: " . $pub->last_response->status_line;/ /print $pub->last_response->status_line, "\n"; # I want to see it even if it didn't fail/ I then went to FeedBurner and added my feed and subscribed to it in Google Reader. I was about to say "Updates show up in Google Reader in seconds" except this one didn't. I'm not sure why but I did find this post [...Get with it, PuSH, http://www.educer.org/2009/09/29/on-pubsubhubbub-part-2-get-with-it-push-youre-supposed-to-be-realtime/] hmmm... [/items/Perl] permanent link


local::lib for local Perl module installs -- it made my day

I recently moved this site to a new ISP and had to install some Perl modules that aren't provided on the server. In my case I also needed to install [Catalyst http://www.catalystframework.org/] which includes dozens of modules and a ton of dependencies. This is a common task for any Perl programmer who doesn't have root or who just wants to install some modules outside the global locations. It's also a common Perl headache. There are plenty of sites on the web that try to tell you how to do this but hardly any mention [local::lib http://search.cpan.org/~apeiron/local-lib/] yet. local::lib has been around a couple of years now and I'm glad I found it. I just followed the instructions for the bootstrapping technique. Download and unpack the local::lib tarball from CPAN as usual and then: perl Makefile.PL --bootstrap make test && make install perl -I$HOME/perl5/lib/perl5 -Mlocal::lib >> ~/.cshrc Works great! [/items/Perl] permanent link