Hello,
The universal feedparser gem [1] that reads web feeds in XML (RSS,
Atom) and JSON (JSON Feed)
now supports HTML feeds w/ Microformats (h-entry, h-feed, etc.) [2][3].
Note: Microformats support in feedparser is optional.
Install and require the the microformats gem[4] to read
feeds in HTML with Microformats.
require 'feedparser'
require 'microformats'
text =<<HTML
<article class="h-entry">
<h1 class="p-name">Microformats are amazing</h1>
<p>Published by
<a class="p-author h-card" href="http://example.com">W. Developer</a>
on <time class="dt-published" datetime="2013-06-13
12:00:00">13<sup>th</sup> June 2013</time>
<p class="p-summary">In which I extoll the virtues of using microformats.</p>
<div class="e-content">
<p>Blah blah blah</p>
</div>
</article>
HTML
feed = FeedParser::Parser.parse( text )
puts feed.format
# => "html"
puts feed.items.size
# => 1
puts feed.items[0].authors.size
# => 1
puts feed.items[0].content_html
# => "<p>Blah blah blah</p>"
puts feed.items[0].content_text
# => "Blah blah blah"
puts feed.items[0].title
# => "Microformats are amazing"
puts feed.items[0].summary
# => "In which I extoll the virtues of using microformats."
puts feed.items[0].published
# => 2013-06-13 12:00:00
puts feed.items[0].authors[0].name
# => "W. Developer"
...
Happy publishing w/ web feeds. Cheers.
[1] https://github.com/feedparser/feedparser
[2] https://github.com/feedparser/feedparser#Microformats
[3] http://microformats.org/wiki/h-entry
[4] https://github.com/indieweb/microformats-ruby