Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created December 17, 2012 20:56
Show Gist options
  • Save coderforhire/4322158 to your computer and use it in GitHub Desktop.
Save coderforhire/4322158 to your computer and use it in GitHub Desktop.
new_playlist["playlists"][0]["assets"].each do |asset|
url_path = url + asset['path'] + 'files/' + asset["title"]
local_file = web_dir + asset["title"]
File.open(web_dir + 'playlist.json', 'w') {|f| f.write(new_playlist_raw) }
if FileTest.exists?(local_file)
pp "#{local_file} ---File Exists Not Downloading---"
else
open( web_dir + asset["title"], 'wb') do |file|
file << open(url_path).read
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment