Robert Citek wrote:

>
> Final version:
>
>   http://www.cwelug.org/cgi-bin/wiki.cgi?Rubypodder#bashpodder2
>
> Added a bit of error checking and simplified the logging.

"The bash-fu is strong with this one".
    -- D. Vader, 1977.

And it is easier to read as well. Nice job.

I also simplified the rubypodder slightly. It now reads all the lines of
the rp.conf file and filters the comments in one step. The delimiter (a
'@' currently) can be changed by editing the DELIM= line at the top.

I experimented with swapping out the Net::HTTP code for a call to exec
wget. But it only was 1 second faster on 2 X mp3s (15M total bytes d/l)
If you want to do this, swap the lines from
response = Net::HTTP.get_response ...
to
    log_it "#{url} was not available" ...
end

with this :
   fork { exec "wget", "-q", "-P", dir, url}

But you will not get HTTP error code handling. (it will fail silently.)
There is probably a way to get it from the error code from exec.

I think the logfile processing should be enhanced. Insead of just
grep-ing the existance of the url, it should parse out the <guid></guid>
tag from the item. This is better than either the full URL or the
<pubDate>. (Although, it is usually the same as the full url) So the
contents of podcast.log (rename to guid.log?) should be guid, and each
new item's guid should be checked for the current existance of it in the
logfile. If new, append the guid to it.

For ref, see:
http://phobos.apple.com/static/iTunesRSS.html

Ed



-- 
Ed Howland
WDT Solutions, LLC.
[EMAIL PROTECTED]
(314) 962-0766

 
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to