Displaying 2 results from an estimated 2 matches for "rssfile".
Did you mean:
rcsfile
2006 Mar 01
1
break in a each function
i have a method , and i only want the first 10 feeds to be put in the
database , why doesn''t this control structure works , when the counter
is 10 it has to jump out the iteration
greetz Klaas
def get_feed2(rssfile)
# Open the RSS file
rssfeed = open(rssfile.url)
# Use the built-in REXML module
# Read the entire RSS file into memory
rssdoc = Document.new rssfeed.read
#Extract some header data about the feed
title = rssdoc.elements[''rss/channel/title...
2006 Mar 17
6
Updated the xml code to be more object-oriented
I changed the code to be more prototype-esque, and created a class
called XMLDoc. I may add more functionality to it later, hence the more
generic name, but you do something like this to convert XML to a hash:
XMLDoc = Class.create();
Object.extend(XMLDoc.prototype, {
initialize: function (xmlDoc) {
this.element = xmlDoc;
},
asHash: function () {
if (! this._xmlHash) {