MB + Last.fm + Discogs = Import!

This commit is contained in:
magnolia-fan
2011-09-26 09:10:23 +04:00
parent 0e04dba130
commit 7582bd18a5
8 changed files with 246 additions and 154 deletions
+2
View File
@@ -2,6 +2,7 @@ namespace :lastfm do
namespace :import do
desc 'Import top 1000 artists from last.fm'
task :top => :environment do
ActiveRecord::Base.logger = Logger.new('/dev/null')
ImportController.parseLastfmXML('tmp/data/top1000.xml').each do |artist|
puts artist[:name] + (artist[:mbid].empty? ? '' : ' (' + artist[:mbid] + ')')
record = Artist.find_or_create_by_name(artist[:name])
@@ -19,6 +20,7 @@ namespace :lastfm do
end
end
task :hyped => :environment do
ActiveRecord::Base.logger = Logger.new('/dev/null')
ImportController.parseLastfmXML('tmp/data/hyped500.xml').each do |artist|
puts artist[:name] + (artist[:mbid].empty? ? '' : ' (' + artist[:mbid] + ')')
record = Artist.find_or_create_by_name(artist[:name])
+8
View File
@@ -0,0 +1,8 @@
namespace :music do
namespace :artist do
desc 'Imports artist'
task :import => :environment do
ImportController.importArtist('Jet')
end
end
end