I am trying to use Hpricot XML feature to parse an RSS feed.
I would like to modify an existing RSS and insert a new element called
"<media:thumb url=... />" inside every item. The item contains other
elements as well.
There is an insert_after method but it seems to be adding the element
at the end of the document.
require 'rubygems'
require 'hpricot'
require 'open-uri'
fh=open('
http://path_to_rss')
doc=Hpricot::XML(fh)
doc.insert_after(Hpricot::XML("<media:thumb url='...' />"),
doc.at("item") )