And Ruby just doesn’t stop surprising us!! In the past we have to deal with XML files and parse them, incredibly easy task using Hpricot library. Now the turn was for OPML(OPML) (Outline Processor Markup Language) files. In case you are not familiar with this type of files, its most common use is to exchange lists of web feeds between web feed aggregators.
We found this function to parse the OPML document recursively preserving its structure in the desktop weblog(desktop weblog), that does the job of extracting the feeds, and modified it a bit. Now it returns a hash containing the title of the articles as keys, and its links as values.
Here’s the function:
1 2 3 4 5 6 7 8 9 10 11 12
All you have to do is call it this way:
1 2 3 4
Pretty easy, huh? Try it out and leave your comments…