Archive for the ‘cpan’ tag
Vitacilina now in Debian + 0.2 released!
Remember Vitacilina? A small aggregation library I wrote last year to be intended to replace Planet on Planeta Linux? Well, it never quite replaced it but it achieved some level of stability since I was using it for a number of tasks at work. So, during this long holiday weekend, I received a notification that the Request To Package bug I had filled against the Work-Needing and Prospective Packages in Debian has already been taken care of and the library had been uploaded. Of course, I could have made this myself a long time ago, but at the time it was simpler and faster just to hope someone else would do it at some point.
So, Dario did it. He packaged it and uploaded version 0.1 under the umbrella of the Debian Perl Group. Hurray!
But then I realized that Alexandr Ciornii had implemented some nice changes to Vitacilina back in September that I never got to include or release as a CPAN distribution. And so I just did. I've uploaded 0.2 to CPAN and you can fetch it with cpanf Vitacilina or wait for the Debian Perl folks to update it
notest from CPAN::Shell
I implemented a simple dependencies installer for the new Planeta Linux. I spent some time trying to find how to make CPAN::Shell::install to install modules without running the test units, it's quite simple.
CPAN::Shell->rematein("notest", "install", $module);
Kudos to mst for the pointer.
Net::Domain::ES::ccTLD
As I'm rewriting the core of Planeta Linux (you can track progress here), I needed a reliable way to map a country TLD to its Spanish name. I headed to CPAN to see what was already built to do that and found out Locales::Country that looked awesome but it didn't work for me, code2country('ni') would return undef for me, plus the countries that were actually there had the encoding all fubar, so fuck it, drop it.
So I came up with Net::Domain::ES::ccTLD using the data from the Spanish Wikipedia for the countries TLDs:
use Net::Domain::ES::ccTLD;
my $country = find_name_by_cctld('mx') # $country is 'México'
or die "Couldn't find name.";
my $current = find_name_by_cctld('us'); # $current is 'Estados Unidos';
Why would I reinvent the wheel for this? Because it was easier and faster for me and it's all about practicality, isn't it? Plus the code is super tiny, maybe the smallest module I have in CPAN in terms of actual code.
Feel free to use if you will.
Quick feed aggregation with Vitacilina
Vitacilina, ¡ah, qué buena medicina!
A few months ago. Maybe more than a year, I started hacking on Vitacilina, which was meant to be the replacement for Planet on all countries Planeta Linux supports. I was doing well, I even hosted the code back then in Google Code. Later, I forgot about it, but I'd always been wanting to replace Planet with some homebrew solution for the Planeta Linux community. Anyway, that hasn't happened yet. However, I did start using Vitacilina for my own needs on a local sandbox for my employer and it used to work pretty well. I've been hacking it to fit very specific requirements, though.
Anyway, I thought it was a good moment to release it publicly, just because it was all hidden there. So, I didn't implement the changes I did for my employer (because they were very specific for our products) but I did clean it up and wrote some documentation.
Now, what exactly is Vitacilina? Well, it's a feed aggregator. It's written in Perl (it's a Perl module) and it uses YAML to get its list of feeds and names and Template Toolkit to format and dump the output, it was efficient for me because it was very easy for me to create dumps:
use Vitacilina;
my $v = Vitacilina->new(
config => "config.yml",
template => "template.tt",
output => "output.html",
);
$v->render;
And that's it. I used to create YAML files on the fly to create new Vitacilina objects and render them according to some data.
The config file would look something like this:
http://myserver.com/myfeed:
name: Some Cool Feed
http://feeds.feedburner.com/InfinitePigTheorem:
name: David Moreno
And the template file:
[% FOREACH p IN data %]
<a href="[% p.permalink %]">[% p.title %]</a>
by <a href="[% p.channelUrl %]">[% p.author %]</a>
[% END %]
In that way, it's very simple, quick and easy to do aggregations. I just love TT, why wouldn't I?
So go grab Vitacilina at CPAN. Also, the Git repo is at github.com/damog/vitacilina.
However… I started to hack on a similar more ambitious project called rFeed, that it's more of a framework than a simple library, which is why I stopped further Vitacilina development. I'll talk about rFeed later when the time comes.



