Some bug fixes

This commit is contained in:
magnolia-fan
2011-10-29 13:34:53 +04:00
parent 9f3a879628
commit 1a5e0cb819
4 changed files with 18 additions and 9 deletions
+9 -4
View File
@@ -126,10 +126,15 @@ class Discogs
end
def self.get_master_albums url
x = Nokogiri::HTML(open(url,
'User-Agent' => 'Haven Search Bot',
'Cookie' => 'artist_layout=med; artist_limit=500'
).read)
begin
xml = open(url,
'User-Agent' => 'Haven Search Bot',
'Cookie' => 'artist_layout=med; artist_limit=500'
).read
rescue => e
xml = ""
end
x = Nokogiri::HTML(xml)
albums = []
split = 0
x.css('table.discography > tbody > tr').each do |_|