19.11.2007 21:04
Jetzt, da die Affero GPLv3 erschienen ist, denke ich ernsthaft an ein nächstes Harvester-Release, ist ja schliesslich Software as a service.
Danach sollte der Code aber wirklich ein Clean-Up.
Im jetzigen Zustand funktioniert er zwar gut, aber falls mal jemand reinguckt, ist mir das eher peinlich.
Dabei würde ich gleich einen schicken Datenbankabstraktionslayer benutzen.
Naturgemäß greife ich dafür zu Momomoto,
da aber einige Harvester-Hoster auf MySQL schwören, kann ich diese PostgreSQL-spezifische Bibliothek nicht einsetzen.
Zum Glück gibt es für Ruby aber eine Menge Alternativen, siehe Wikipedia.
Ich hatte den Harvester zwischenzeitlich schon in C++ und in Erlang begonnen.
Falls sich Mithacker finden, dann ist das Motivation, ansonsten gehts in Ruby weitaus schneller.
2.8.2007 22:48
Dank toidinamai ist der Harvester jetzt auch unter
blog-harvester.de
erreichbar. Jetzt können sich alle Nutzer die Adresse besser
merken, ist es doch für unterwegs oder die Ewiggestrigen ohne
Feedaggregator gedacht.
Achja. Ich wünsche mir noch C++-Götter mit zuviel Zeit
für Harvester-CC
(git,
gitweb),
einem Rewrite, weil mir C++ gerade Spaß macht. Ich habe schon
ziemlich genaue Ideen wie das werden soll, befasse mich aber zur
Zeit noch mit dem Wrappen von libevent
und udns. Dokumentieren kann ich auf Nachfrage. :-)
Eine weitere Idee hat ebenfalls toidinamai gehabt: man
könnte Anpassungen der dargestellten Datensätze per Javascript
vornehmen und die persönlichen Einstellungen als Cookies
speichern; ein bisschen mehr in Richtung web-basierter
Feedreader, was der Harvester ja eigentlich auch ist. Wer
hat Lust auf sowas?
24.5.2007 23:55
Well, I always want to write more often here, but I'm lazy and
then I think: I would be more productive if I generate some
more code now.
This post is in english because there are a
few
similar
projects
out
there.
But I haven't looked at them at any depth because MRSS is
the Harvester's core component and must always be
tweakable to fit my needs.
MRSS was written when I knew just the basics of the three common
feed formats RSS 0.9/2.0, RSS 1.0 (RDF) and ATOM 0.3/1.0.
Almost everytime I added another feed from a different Blog
Software I've had to add further hacks to MRSS.
It always choked on differently styled feeds with their various
forms of plain text and markup embedding, escaping and
inclusion.
I also avoided most ATOM feeds because it was... broken.
A few days ago I
turned Stepardo's
blog to Harvester food and was once reminded how crappy
MRSS was. Time to refactor. Time to rewrite.
I now wish to point the reader to the
source
browser for a better understanding of the following
discussion. You can now see a pattern I tend to use very often
in my small Ruby projects. I'd like to call
it Intrusive Decorators.
A way of doing things with a class, here REXML::Element,
could be deriving from it and adding functions. But in this case
you'll also have to convert the element's children to that
class. Something we do in XMPP4R everywhere, but it's
hairy, especially in combination with a monster like REXML.
When your functionality is just a short-cut like in this
example one would normally create a Class Method (aka Static
Function in other languages) and implement it there.
But that's way too much to write when you're just using it.
In Ruby it's possible to modify classes after
their end. You just define it again, but this time
without a class it derives from.
This technique can not only be used to create such short-cuts
like MRSS' REXML::Element#s but also to add completely
new features to already existing applications.
See my Ruby-SOCKSify mini-library
(GIT,
Browse) for
example.
Please pay attention to the handsome function style that can be
seen in MRSS::RSS::Item#description. Make use
of nil, false and NULL everywhere and in
any language!
So much talk but nothing that makes a better MRSS.
The key feature is object-oriented abstraction to distinguish
between feed formats. This is the only and right way to do it,
and now I really wonder why I didn't use it back when I wrote
the first version of MRSS. Maybe because I concentrated on just
RSS while ATOM support was given birth by Neingeist.
Hell, I'm really proud of that new code. Code which violates some
basic OOP rules, I guess. But that makes it even more fun.
Feel free to show me (well-formed) feeds that don't display
nicely in the Harvester and I'll fix that.
I'm also thinking about some test-cases.
Test data
(thanks to fukami for showing me this once) exist. But I
like to have the same content everywhere for minimal test code.
Anyway, it's working fine for now.
If I'll touch MRSS again it will be kicking REXML, the
XML library I know best and which has an easy API. But it is
also bloated, sometimes buggy and handles namespaces &
element name prefixes the way you
don't want to handle them when processing documents with
multiple namespaces.
6.1.2007 12:50
Da gibt es Software, um die man sich mit Hackern aus der ganzen Welt kümmert, zum Beispiel xmpp4r oder Ruby-IXP, und dann gibt es Software, die eher kleine Hacks darstellen.
Für die erste Kategorie gibt es Seiten wie Gna! Aber eigentlich will man überall Versionskontrolle, auch dort wo man noch nicht so viel Code vorzuweisen hat. Und zumindest bei Gna! wird verlangt, dass bereits Code existiert.
Aber seit svn.c3d2.de gibt es die Möglichkeit schnell selbst ein Repository einzurichten, selbst zu administrieren, und, ausreichend dokumentiert natürlich, ein Trac unter trac.c3d2.de zu bauen.
Dank dessen habe ich vor geraumer Zeit SVN & Trac für das Astroblog, sowie SVN & Trac für den Harvester eingerichtet.
Ich habe damit die leise Hoffnung, dass die Hürden sich am Code zu beteiligen nun niedriger sind.
Während das Astroblog bestimmt kaum jemanden interessiert, der nicht tierisch auf Ruby, XSLT und PostgreSQL abgeht,
so habe ich schon vorher Patches für den Harvester erhalten.
Und vor ein paar Wochen habe ich da sogar weitere Features reingehackt.
Erstens ist diese widerliche Templatesprache gekickt und durch, wer hätte es gedacht, XSLT ersetzt.
Nicht dass es jetzt schneller und cooler wäre, aber XSLT ist flexibler und wird von mehr Menschen beherrscht.
Zweitens versucht das Ding nun leere Einträge (im Sinne von Link & Titel) ganz zu ignorieren,
drittens können Einträge nun optional mit htree geparst werden,
wo dann der Harvester gleich schaut, ob //a/@href oder //img/@src relativ sind und in absolute URLs umschreibt.
Der öffentliche Harvester läuft schon auf trunk™, womit nun mehr Links und Bilder stimmen sollten.
Trotzdem hakt es hie und da noch ein wenig, ist aber bei mir niedrig priorisiert.
Übrigens hat MaxX endlich mal einiges seiner Software publiziert.
Dort finden sich viele, äh, unportable Dinge, sowie ein paar lehrreiche Hacks.
Zum Beispiel Sniffed Network Graphics (or SuperNailGun), was wir hackten als wir von EtherPEG hörten und Driftnet noch nicht kannten.