Archive for the ‘feed’ tag
Feed moved
I have always been against FeedBurner. I don't like it at all. I've never liked it, as a matter of fact, I have no actual idea why I've been using it on my blog. I do know why I used it on the country feeds on Planeta Linux, and that is because it was very easy to mask all of our URL changes with some level of stability on the subscribers (in times where me being technically competent was a bad joke for myself). Plus, we could plug AdSense into it (that later on I removed because I like to earn actual dollars, not pennies, you cheap clickers!). Or maybe I'm just so against it because of pure jealousy: A few RSS feed geeks, like myself, sold a sub-parproduct to Google in a hundred million dollars. At the very end, I've never had a good reason to use FeedBurner or to stick with it, so hereby I'm dropping it entirely from my own personal blog.
It's obvious that some people who subscribed to my feed using that FeedBurner URL aren't reading this very blog post. It's alright, I've lost reigns before, I will get over it and conquer their hearts again. But you, dear blog reader, planet subscriber, or eventual visitor, have the power to change things, to help workaround the evils of FeedBurner and make me be myself again. Please, help me myself again! And that is, from now on, use this feed URL and only this feed URL, I promise I will support as long as nice good looking HTTP servers (such as nginx or Cherokee) exist:
http://stereonaut.net/feed/
That said, I will get you a beer next time we meet each other and you, dear reader, mention this blog post and mention that you changed to this new feed URL of mine. I'm not kidding. Just go ahead and tell me
Thank you.
Perl on the NYMag
Reading my morning load of feed news, I spotted an interesting bit on the New York Magazine travel feed:

Of course, someone's doing something wrong there, but I'd say it's their usage of XML::Feed (my guess on what they are using since the generator tag is omitted), by not dereferencing that hash reference or trying to forcibly stringify it.
Of course that comes from the feed itself:

It's awesome, and nothing new of course, that big publications and organizations are using Perl to process and offer data to users, but I find it always super cool when they make it so obvious
Feedbag now using feedvalidator
There's a very special case that I hadn't spotted on Feedbag. Within the different methods that Feedbag uses to discover the feed on a given URL, the very first one is lookup on a table of "known" content types. If the alleged feed is served with any of the following content types, then Feedbag just returns that same URL as it assumes it's the feed:
@content_types = [
'application/x.atom+xml',
'application/atom+xml',
'application/xml',
'text/xml',
'application/rss+xml',
'application/rdf+xml',
]
However, what happens if the feed is not served with any of those but it's a valid feed? Well, Feedbag wouldn't auto-discover the feed itself but would start parsing the HTML, which is time-consuming (and unneeded after all). Because of this, between the content type lookup and the HTML parsing, I've added W3C feed validation using the nice gem feedvalidator. However, since this would result on an extra dependency, I've left it as optional. If the gem is available, it'll use it, otherwise, it won't and will start parsing the HTML.
You can see the fix patch on this commit.
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.
Introducing Feedbag: Feed auto-discovery Ruby library/tool
Last week, I spent some time building a good (that I liked) feed auto-discovery tool to use in Ruby for other project I'm building, rFeed. I liked CPAN's Feed::Find, and at some point I made a wrapper class to run a Perl script using such module, however, I wasn't happy by mixing it all. So, Feedbag was born:
>> require "rubygems" => true >> require "feedbag" => true >> Feedbag.find "log.damog.net" => ["http://feeds.feedburner.com/TeoremaDelCerdoInfinito", "http://log.damog.net/comments/feed/"]>> planet_feeds = Feedbag.find("planet.debian.org") [ ... ] >> planet_feeds.first(3) => ["http://planet.debian.org/rss10.xml", "http://planet.debian.org/rss20.xml", "http://planet.debian.org/atom.xml"] >>planet_feeds.size => 104 >>
It makes smart use of relative and absolute bases, hrefs, links, content types, etc. It is also a single Ruby file, so you can grab it and use it on your application. Plus, it only requires Hpricot as dependency. It can find all feeds linked on a web page, but it will return the most important at the beginning of the resulting array, so you will have the important one on the first results (see example above with Planet Debian).
Synopsis, README and a brief tutorial have been placed at axiombox.com/feedbag. You can also take a look at the git repo, hosted in GitHub.



