I wrote a rexml script that parses rather big xml files (DOM parsing)
builds an object out of them. This is what it looks like after i parse
xml file and display the object:
[#<Article:0xb79e7428 @brand="This is a story from ", @id=5337,
@fblurb=“burb”, @ntype=“news type here”, @copy="Copyright \302\251 2006
@source=“source”, @body=“body”, @archive=nil, @att=“attribution here”,
@blurb=“Signs and symptoms of food poisoning”, @post=nil, @fimage=nil,
@head=“Health Tip: Eaten Bad Food?”>]
I have a database schema that looks like this:
create table Newsfeeds (
What i need to do is put each parsing from the constructed data object
its place in the database. This is not inside of a rails application.
is a ruby script that will be run from a cron on a linux box. How is
best way to approach this problem? I am a little new at Ruby and i have
been going through the docs, but, if anyone can offer a suggestion that
would be wonderful.
Thanks a lot, your time is much appreciated.