Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'xmlsimple'
- require 'open-uri'
- require 'fileutils'
- xml = open('http://feeds.feedburner.com/NintendoNowBlogspotPodcast').read
- hash = XmlSimple.xml_in(xml)
- url = hash['channel'][0]['item'][0]['enclosure'][0]['url']
- temp = open(url)
- show_num = url[url.length - 7, 3]
- item_fname = "gnpodcast_" + show_num + ".mp3"
- new_path = File.expand_path(item_fname, "~/Desktop")
- FileUtils.mv(temp.path, new_path)
Advertisement
Add Comment
Please, Sign In to add comment