meer opruimen

This commit is contained in:
Ward Wouts 2006-02-14 21:27:42 +00:00
parent 80f7c27c14
commit 5e553cdd9c

View file

@ -59,15 +59,9 @@ def deleteold(podcast)
}
end
for podcast in @podcasts.keys.sort
puts podcast
res = fetch(@podcasts[podcast]["rss"])
@filelist = {}
xmldoc = REXML::Document.new(res.body)
xmldoc.elements.each("rss/channel/*/enclosure") {|x|
if ! x.attribute("url").nil?
cast = x.attribute("url").to_s.dup
def getenclosure(podcast, enclosure)
if ! enclosure.attribute("url").nil?
cast = enclosure.attribute("url").to_s.dup
filename = cast.dup
filename.sub!(/^.*\//, "")
if @podcasts[podcast]["rename"]
@ -82,6 +76,16 @@ for podcast in @podcasts.keys.sort
}
end
end
end
for podcast in @podcasts.keys.sort
puts podcast
res = fetch(@podcasts[podcast]["rss"])
@filelist = {}
xmldoc = REXML::Document.new(res.body)
xmldoc.elements.each("rss/channel/*/enclosure") {|enclosure|
getenclosure(podcast, enclosure)
}
if @podcasts[podcast]["delete"]
deleteold(podcast)