new symlinky magic and commented config
This commit is contained in:
parent
063394d20f
commit
bd905b242e
1 changed files with 16 additions and 1 deletions
|
|
@ -19,11 +19,20 @@
|
|||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
########################################
|
||||
# the configuration bit
|
||||
|
||||
@podcasts = {
|
||||
# the podcast name
|
||||
"distortedview" => {
|
||||
# where's the rss file
|
||||
"rss" => 'http://www.distortedview.com/show/index.xml',
|
||||
"savedir" => '/Users/ward/ipod_sync/[books]/Distorted View',
|
||||
# where should enclosures be saved
|
||||
"savedir" => '/Users/ward/Private/mp3/[books]/Distorted View',
|
||||
# rename magic, this is used on the file name with sub!
|
||||
"rename" => [ /_(\d\d\d\d)(\d\d)/, '\2\1' ],
|
||||
# directory to put symlinks to the new files
|
||||
"linkdir" => '/Users/ward/ipod_sync/[books]/Distorted View',
|
||||
},
|
||||
"tagesschau" => {
|
||||
"rss" => 'http://www.tagesschau.de/export/podcast',
|
||||
|
|
@ -32,6 +41,9 @@
|
|||
},
|
||||
}
|
||||
|
||||
########################################
|
||||
# code from here on
|
||||
|
||||
require 'net/http'
|
||||
require 'uri'
|
||||
require 'rexml/document'
|
||||
|
|
@ -74,6 +86,9 @@ def getenclosure(podcast, enclosure)
|
|||
File.open("#{@podcasts[podcast]["savedir"]}/#{filename}", "w"){|f|
|
||||
f.print(response.body)
|
||||
}
|
||||
if @podcasts[podcast]["linkdir"]
|
||||
File.symlink("#{@podcasts[podcast]["savedir"]}/#{filename}", "#{@podcasts[podcast]["linkdir"]}/#{filename}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue