podcasts-rss.lua 457 B

12345678910111213141516171819
  1. #!/usr/bin/env lua
  2. -- ensure Recorder.lua (next to this file) is found:
  3. package.path = arg[0]:gsub("/[^/]+/?$", '') .. "/?.lua;" .. package.path
  4. require'Recorder'
  5. Recorder.chdir2app_root( arg[0] )
  6. for _,pc in pairs(Podcast:each()) do
  7. local ok,file,msg,err = pcall(Podcast.save_rss, pc)
  8. if ok and file then
  9. io.stderr:write(msg, ' ', file, "\n")
  10. else
  11. if not ok then
  12. err = file
  13. msg = 'fatal'
  14. end
  15. io.stderr:write(msg, ' ', err, "\n")
  16. end
  17. end