Created
December 17, 2012 21:00
-
-
Save coderforhire/4322209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if current_playlist_published < new_playlist_published | |
new_playlist["playlists"][0]["assets"].each do |asset| | |
url_path = url + asset['path'] + 'files/' + asset["title"] | |
local_file = web_dir + asset["title"] | |
file_list = [] | |
file_list << 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 | |
dir_contents = Dir.glob(web_dir + '*') | |
puts dir_contents | |
puts file_list | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment