insound_api 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,68 @@
1
+ module InsoundApi
2
+ class Results
3
+
4
+ attr_reader :warnings, :doc
5
+
6
+ # takes a nokogiri document
7
+ def initialize(document)
8
+ @doc = document
9
+ end
10
+
11
+ def search_url
12
+ @search_url ||= parse_str('search_url')
13
+ end
14
+
15
+ def products
16
+ @products ||= parse_objects('product_matches product', Product)
17
+ end
18
+
19
+ def products_total
20
+ @products_total ||= parse_int('total_product_results')
21
+ end
22
+
23
+ def artists
24
+ @artists ||= parse_objects('artist_matches artist', Artist)
25
+ end
26
+
27
+ def artists_total
28
+ @artists_total ||= parse_int('total_artist_results')
29
+ end
30
+
31
+ def total_results
32
+ @total_results ||= parse_int('total_results')
33
+ end
34
+
35
+
36
+
37
+ def parse_objects(selector, klass)
38
+ nodes = doc.css(selector)
39
+ nodes.map{|n| klass.new(n) }
40
+ end
41
+
42
+
43
+ def parse_int(selector)
44
+ Results.parse_int(selector, doc)
45
+ end
46
+
47
+ def self.parse_int(selector, doc)
48
+ nodes = doc.css(selector)
49
+ if nodes.any?
50
+ nodes.first.inner_html.strip.to_i
51
+ else
52
+ 0
53
+ end
54
+ end
55
+
56
+ def parse_str(selector)
57
+ Results.parse_str(selector, doc)
58
+ end
59
+
60
+ def self.parse_str(selector, doc)
61
+ nodes = doc.css(selector)
62
+ if nodes.any?
63
+ nodes.first.inner_html.strip
64
+ end
65
+ end
66
+
67
+ end
68
+ end
@@ -0,0 +1,11 @@
1
+ require 'helper'
2
+
3
+ class ConfigTest < Test::Unit::TestCase
4
+
5
+ should 'raise exception if not configured' do
6
+ assert_raise InsoundApi::ConfigException do
7
+ InsoundApi::Request.get(:artist => 'sdf')
8
+ end
9
+ end
10
+
11
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,69 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+
14
+ unless ENV['NO_MOCKING']
15
+ require 'webmock/test_unit'
16
+ end
17
+
18
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
19
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
20
+ require 'insound_api'
21
+
22
+ class Test::Unit::TestCase
23
+
24
+ def mocking?
25
+ !ENV['NO_MOCKING']
26
+ end
27
+
28
+ def setup_credentials
29
+ if mocking?
30
+ setup_test_credentials
31
+ else
32
+ setup_credentials_from_config
33
+ # give their webserver a little break
34
+ sleep(1) unless mocking?
35
+ end
36
+ end
37
+
38
+ def setup_test_credentials
39
+ InsoundApi.setup do |config|
40
+ config.affiliate_id = 42
41
+ config.api_password = 'fart'
42
+ end
43
+ end
44
+
45
+
46
+ def setup_credentials_from_config
47
+ h = YAML.load_file('config.yml')
48
+ InsoundApi.setup do |config|
49
+ config.affiliate_id = h['affiliate_id']
50
+ config.api_password = h['api_password']
51
+ end
52
+ end
53
+
54
+ def mock(name, query_string)
55
+ return unless mocking?
56
+
57
+ dir = File.dirname(__FILE__) + "/webmock/#{name}.xml"
58
+ file = File.open(dir)
59
+ body = file.read
60
+ url = "https://www.insound.com/ws/affiliate/#{query_string}&id=42&password=fart"
61
+ stub_request(:get, url).to_return(:status => 200, :body => body)
62
+ end
63
+
64
+ def teardown
65
+ InsoundApi.instance_variable_set(:@config, nil)
66
+ WebMock.reset! if mocking?
67
+ end
68
+
69
+ end
@@ -0,0 +1,140 @@
1
+ $:.unshift '.';require File.dirname(__FILE__) + '/helper'
2
+
3
+ module InsoundApi
4
+ class QueryTest < Test::Unit::TestCase
5
+
6
+ context 'with credentials' do
7
+ setup do
8
+ setup_credentials
9
+ end
10
+
11
+
12
+
13
+ context 'search by artist returning no results' do
14
+ setup do
15
+ mock(:no_results_found, "?artist=xxcxccxcx")
16
+ @results = Query.search(:artist => 'xxcxccxcx')
17
+ end
18
+
19
+ should 'return empty stuff' do
20
+ assert_equal [], @results.products
21
+ assert_equal [], @results.artists
22
+
23
+ assert_equal 0, @results.products_total
24
+ assert_equal 0, @results.artists_total
25
+ assert_equal 0, @results.total_results
26
+ assert @results.search_url
27
+ end
28
+ end
29
+
30
+ context 'using module search' do
31
+ setup do
32
+ mock(:no_results_found, "?artist=xxcxccxcx")
33
+ @results = InsoundApi.search(:artist => 'xxcxccxcx')
34
+ end
35
+
36
+ should 'return empty stuff' do
37
+ assert_equal [], @results.products
38
+ assert_equal [], @results.artists
39
+
40
+ assert_equal 0, @results.products_total
41
+ assert_equal 0, @results.artists_total
42
+ assert_equal 0, @results.total_results
43
+ assert @results.search_url
44
+ end
45
+ end
46
+
47
+ context 'search artist vinyl format' do
48
+ setup do
49
+ mock(:jimmy_eat_world_vinyl, "?artist=Jimmy%20Eat%20World&format=vinyl")
50
+ @results = Query.search(:artist => 'Jimmy Eat World', :format => 'vinyl')
51
+ end
52
+
53
+ should 'return actual stuff' do
54
+ assert_equal 3, @results.products.length
55
+ assert_equal 1, @results.artists.length
56
+
57
+ assert_equal 3, @results.products_total
58
+ assert_equal 1, @results.artists_total
59
+ assert_equal 4, @results.total_results
60
+ assert_nil @results.search_url
61
+
62
+ product = @results.products.first
63
+ assert product.url
64
+ assert_equal 'Jimmy Eat World', product.artist_name
65
+ assert_equal 'Invented', product.title
66
+ assert_equal 'Vinyl LP', product.format
67
+ assert_equal 'INS79668', product.id
68
+
69
+ artist = @results.artists.first
70
+ assert artist.url
71
+ assert_equal 'Jimmy Eat World', artist.name
72
+ assert_equal 19191, artist.id
73
+ end
74
+ end
75
+
76
+ context 'search with bumped maxresults' do
77
+ setup do
78
+ mock(:maxresults, "?artist=arcade&maxresults=100")
79
+ @results = Query.search(:artist => 'arcade', :maxresults => 100)
80
+ end
81
+
82
+ should 'return multiple artists and products' do
83
+ assert_equal 30, @results.products.length
84
+ assert_equal 7, @results.artists.length
85
+
86
+ assert_equal 30, @results.products_total
87
+ assert_equal 7, @results.artists_total
88
+ assert_equal 37, @results.total_results
89
+ assert_nil @results.search_url
90
+
91
+ product = @results.products.first
92
+ assert product.url
93
+ assert_equal 'Arcade Fire', product.artist_name
94
+ assert_equal 'Funeral', product.title
95
+ assert_equal 'CD', product.format
96
+ assert_equal 'INS23877', product.id
97
+
98
+ artist = @results.artists.first
99
+ assert artist.url
100
+ assert_equal 'Arcade Fire', artist.name
101
+ assert_equal 29908, artist.id
102
+ end
103
+ end
104
+
105
+
106
+ context 'search using title' do
107
+ setup do
108
+ mock(:zen_arcade, "?artist=husker&title=zen%20arcade")
109
+ @results = Query.search(:artist => 'husker', :title => 'zen arcade')
110
+ end
111
+
112
+ should 'return multiple artists and products' do
113
+ assert_equal 2, @results.products.length
114
+ assert_equal 1, @results.artists.length
115
+
116
+ assert_equal 2, @results.products_total
117
+ assert_equal 1, @results.artists_total
118
+ assert_equal 3, @results.total_results
119
+ assert_nil @results.search_url
120
+
121
+ product = @results.products.first
122
+ assert product.url
123
+ assert_equal 'Husker Du', product.artist_name
124
+ assert_equal 'Zen Arcade', product.title
125
+ assert_equal 'Vinyl LP', product.format
126
+ assert_equal 'INS13241', product.id
127
+
128
+ artist = @results.artists.first
129
+ assert artist.url
130
+ assert_equal 'Husker Du', artist.name
131
+ assert_equal 21544, artist.id
132
+ end
133
+ end
134
+
135
+ end
136
+
137
+
138
+
139
+ end
140
+ end
@@ -0,0 +1,41 @@
1
+ $:.unshift '.';require File.dirname(__FILE__) + '/helper'
2
+
3
+ module InsoundApi
4
+ class RequestTest < Test::Unit::TestCase
5
+
6
+ context 'with credentials' do
7
+ setup do
8
+ setup_credentials
9
+ end
10
+
11
+ should 'raise if errors in response' do
12
+ if !mocking?
13
+ setup_test_credentials
14
+ end
15
+
16
+ mock(:bad_credentials, "?artist=townes%20van%20zandt&id=42&password=yyyyyy")
17
+ ex = assert_raise(RequestException) { Request.get(:artist => "townes van zandt") }
18
+ assert ex.message =~ /Invalid account information/i
19
+ end
20
+
21
+ should 'correctly build_url' do
22
+ if mocking?
23
+ request = Request.new(:artist => "townes van zandt")
24
+ assert_equal 'https://www.insound.com/ws/affiliate/?id=42&password=fart&artist=townes%20van%20zandt', request.build_url
25
+ end
26
+ end
27
+
28
+ should 'raise RequestException if artist not provided' do
29
+ ex = assert_raise(RequestException) { Request.get }
30
+ assert_equal ":artist is a required param for any request", ex.message
31
+ end
32
+
33
+ should 'raise RequestException if invalid format provided' do
34
+ ex = assert_raise(RequestException) { Request.get(:artist => 'blah', :format => 'fat32') }
35
+ assert_equal ":format must be one of the follwing: all, vinyl, seveninch, digital, poster, shirt, cd", ex.message
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,40 @@
1
+ require 'helper'
2
+
3
+ module InsoundApi
4
+ class ResponseTest < Test::Unit::TestCase
5
+
6
+ should 'parse xml into a nokogiri document' do
7
+ response = Response.new(:raw_xml => '<blah>1</blah>')
8
+ doc = response.doc
9
+
10
+ assert_equal Nokogiri::XML::Document, doc.class
11
+ assert_equal '1', doc.css('blah').first.inner_html
12
+ end
13
+
14
+ should 'report errors if any' do
15
+ xml = <<THEXML
16
+ <insound_query_response>
17
+ <errors>
18
+ <request_error>
19
+ <error_code>102</error_code>
20
+ <error_text>Invalid account information.</error_text>
21
+ </request_error>
22
+ <request_error>
23
+ <error_code>101</error_code>
24
+ <error_text>Missing required parameters</error_text>
25
+ </request_error>
26
+ </errors>
27
+ </insound_query_response>
28
+ THEXML
29
+
30
+ response = Response.new(:raw_xml => xml)
31
+
32
+ assert response.errors?
33
+
34
+ errors = [{:code=>"102", :text=>"Invalid account information."},
35
+ {:code=>"101", :text=>"Missing required parameters"}]
36
+ assert_equal errors, response.errors
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,8 @@
1
+ <insound_query_response>
2
+ <errors>
3
+ <request_error>
4
+ <error_code>102</error_code>
5
+ <error_text>Invalid account information.</error_text>
6
+ </request_error>
7
+ </errors>
8
+ </insound_query_response>
@@ -0,0 +1,45 @@
1
+ <insound_query_response>
2
+ <warnings/>
3
+ <errors/>
4
+ <product_matches>
5
+ <product>
6
+ <url>
7
+ http://www.insound.com/Invented-Vinyl-LP-Jimmy-Eat-World/P/INS79668/&from=86902
8
+ </url>
9
+ <artist_name>Jimmy Eat World</artist_name>
10
+ <title>Invented</title>
11
+ <format>Vinyl LP</format>
12
+ <product_id>INS79668</product_id>
13
+ </product>
14
+ <product>
15
+ <url>
16
+ http://www.insound.com/Chase-This-Light-Vinyl-LP-Jimmy-Eat-World/P/INS39744/&from=86902
17
+ </url>
18
+ <artist_name>Jimmy Eat World</artist_name>
19
+ <title>Chase This Light</title>
20
+ <format>Vinyl LP</format>
21
+ <product_id>INS39744</product_id>
22
+ </product>
23
+ <product>
24
+ <url>
25
+ http://www.insound.com/Bleed-American-Vinyl-3xLP-Jimmy-Eat-World/P/INS111472/&from=86902
26
+ </url>
27
+ <artist_name>Jimmy Eat World</artist_name>
28
+ <title>Bleed American</title>
29
+ <format>Vinyl 3xLP</format>
30
+ <product_id>INS111472</product_id>
31
+ </product>
32
+ </product_matches>
33
+ <artist_matches>
34
+ <artist>
35
+ <artist_name>Jimmy Eat World</artist_name>
36
+ <url>
37
+ http://www.insound.com/Jimmy-Eat-World/A/19191/&from=86902
38
+ </url>
39
+ <artist_id>19191</artist_id>
40
+ </artist>
41
+ </artist_matches>
42
+ <total_results>4</total_results>
43
+ <total_product_results>3</total_product_results>
44
+ <total_artist_results>1</total_artist_results>
45
+ </insound_query_response>
@@ -0,0 +1,332 @@
1
+ <insound_query_response>
2
+ <warnings/>
3
+ <errors/>
4
+ <product_matches>
5
+ <product>
6
+ <url>
7
+ http://www.insound.com/Funeral-CD-Arcade-Fire/P/INS23877/&from=86902
8
+ </url>
9
+ <artist_name>Arcade Fire</artist_name>
10
+ <title>Funeral</title>
11
+ <format>CD</format>
12
+ <product_id>INS23877</product_id>
13
+ </product>
14
+ <product>
15
+ <url>
16
+ http://www.insound.com/The-Suburbs-Vinyl-2xLP-Arcade-Fire/P/INS76692/&from=86902
17
+ </url>
18
+ <artist_name>Arcade Fire</artist_name>
19
+ <title>The Suburbs</title>
20
+ <format>Vinyl 2xLP</format>
21
+ <product_id>INS76692</product_id>
22
+ </product>
23
+ <product>
24
+ <url>
25
+ http://www.insound.com/Neon-Bible-Vinyl-LP-Arcade-Fire/P/INS33679/&from=86902
26
+ </url>
27
+ <artist_name>Arcade Fire</artist_name>
28
+ <title>Neon Bible</title>
29
+ <format>Vinyl LP</format>
30
+ <product_id>INS33679</product_id>
31
+ </product>
32
+ <product>
33
+ <url>
34
+ http://www.insound.com/Neon-Bible-CD-Arcade-Fire/P/INS33678/&from=86902
35
+ </url>
36
+ <artist_name>Arcade Fire</artist_name>
37
+ <title>Neon Bible</title>
38
+ <format>CD</format>
39
+ <product_id>INS33678</product_id>
40
+ </product>
41
+ <product>
42
+ <url>
43
+ http://www.insound.com/Neon-Bible-Deluxe-Edition-CD-Arcade-Fire/P/INS33683/&from=86902
44
+ </url>
45
+ <artist_name>Arcade Fire</artist_name>
46
+ <title>Neon Bible (Deluxe Edition)</title>
47
+ <format>CD</format>
48
+ <product_id>INS33683</product_id>
49
+ </product>
50
+ <product>
51
+ <url>
52
+ http://www.insound.com/Funeral-Reissue-Vinyl-LP-Arcade-Fire/P/INS70891/&from=86902
53
+ </url>
54
+ <artist_name>Arcade Fire</artist_name>
55
+ <title>Funeral (Reissue)</title>
56
+ <format>Vinyl LP</format>
57
+ <product_id>INS70891</product_id>
58
+ </product>
59
+ <product>
60
+ <url>
61
+ http://www.insound.com/Arcade-Fire-CDep-Arcade-Fire/P/INS26865/&from=86902
62
+ </url>
63
+ <artist_name>Arcade Fire</artist_name>
64
+ <title>Arcade Fire</title>
65
+ <format>CDep</format>
66
+ <product_id>INS26865</product_id>
67
+ </product>
68
+ <product>
69
+ <url>
70
+ http://www.insound.com/May-29-30-2007-Show-Poster-poster-Arcade-Fire/P/INS36391/&from=86902
71
+ </url>
72
+ <artist_name>Arcade Fire</artist_name>
73
+ <title>May 29 & 30, 2007 Show Poster</title>
74
+ <format>Poster</format>
75
+ <product_id>INS36391</product_id>
76
+ </product>
77
+ <product>
78
+ <url>
79
+ http://www.insound.com/The-Suburbs-CD-Arcade-Fire/P/INS76693/&from=86902
80
+ </url>
81
+ <artist_name>Arcade Fire</artist_name>
82
+ <title>The Suburbs</title>
83
+ <format>CD</format>
84
+ <product_id>INS76693</product_id>
85
+ </product>
86
+ <product>
87
+ <url>
88
+ http://www.insound.com/Miroir-Noir-Deluxe-Edition-2xDVD-Arcade-Fire/P/INS54522/&from=86902
89
+ </url>
90
+ <artist_name>Arcade Fire</artist_name>
91
+ <title>Miroir Noir (Deluxe Edition)</title>
92
+ <format>2xDVD</format>
93
+ <product_id>INS54522</product_id>
94
+ </product>
95
+ <product>
96
+ <url>
97
+ http://www.insound.com/The-Suburbs-MP3-Arcade-Fire/P/INS78922/&from=86902
98
+ </url>
99
+ <artist_name>Arcade Fire</artist_name>
100
+ <title>The Suburbs</title>
101
+ <format>MP3</format>
102
+ <product_id>INS78922</product_id>
103
+ </product>
104
+ <product>
105
+ <url>
106
+ http://www.insound.com/The-Suburbs-Deluxe-Edition-CD-and-DVD-Arcade-Fire/P/INS96835/&from=86902
107
+ </url>
108
+ <artist_name>Arcade Fire</artist_name>
109
+ <title>The Suburbs (Deluxe Edition)</title>
110
+ <format>CD+DVD</format>
111
+ <product_id>INS96835</product_id>
112
+ </product>
113
+ <product>
114
+ <url>
115
+ http://www.insound.com/Outlands-Vinyl-LP-Deep-Sea-Arcade/P/INS108373/&from=86902
116
+ </url>
117
+ <artist_name>Deep Sea Arcade</artist_name>
118
+ <title>Outlands</title>
119
+ <format>Vinyl LP</format>
120
+ <product_id>INS108373</product_id>
121
+ </product>
122
+ <product>
123
+ <url>
124
+ http://www.insound.com/Power-Out-CDep-Arcade-Fire/P/INS26778/&from=86902
125
+ </url>
126
+ <artist_name>Arcade Fire</artist_name>
127
+ <title>Power Out</title>
128
+ <format>CDep</format>
129
+ <product_id>INS26778</product_id>
130
+ </product>
131
+ <product>
132
+ <url>
133
+ http://www.insound.com/Spring-Tour-2011-3-Chicago-poster-Arcade-Fire/P/INS95618/&from=86902
134
+ </url>
135
+ <artist_name>Arcade Fire</artist_name>
136
+ <title>Spring Tour 2011 #3 (Chicago)</title>
137
+ <format>Poster</format>
138
+ <product_id>INS95618</product_id>
139
+ </product>
140
+ <product>
141
+ <url>
142
+ http://www.insound.com/Miroir-Noir-DVD-Arcade-Fire/P/INS54521/&from=86902
143
+ </url>
144
+ <artist_name>Arcade Fire</artist_name>
145
+ <title>Miroir Noir</title>
146
+ <format>DVD</format>
147
+ <product_id>INS54521</product_id>
148
+ </product>
149
+ <product>
150
+ <url>
151
+ http://www.insound.com/December-5-6-2010-Show-Poster-poster-Arcade-Fire/P/INS90082/&from=86902
152
+ </url>
153
+ <artist_name>Arcade Fire</artist_name>
154
+ <title>December 5-6, 2010 Show Poster</title>
155
+ <format>Poster</format>
156
+ <product_id>INS90082</product_id>
157
+ </product>
158
+ <product>
159
+ <url>
160
+ http://www.insound.com/June-30-2011-Show-Poster-poster-Arcade-Fire/P/INS98765/&from=86902
161
+ </url>
162
+ <artist_name>Arcade Fire</artist_name>
163
+ <title>June 30, 2011 Show Poster</title>
164
+ <format>Poster</format>
165
+ <product_id>INS98765</product_id>
166
+ </product>
167
+ <product>
168
+ <url>
169
+ http://www.insound.com/Spring-Tour-2011-1-West-Coast-poster-Arcade-Fire/P/INS95619/&from=86902
170
+ </url>
171
+ <artist_name>Arcade Fire</artist_name>
172
+ <title>Spring Tour 2011 #1 (West Coast)</title>
173
+ <format>Poster</format>
174
+ <product_id>INS95619</product_id>
175
+ </product>
176
+ <product>
177
+ <url>
178
+ http://www.insound.com/Funeral-MP3-Arcade-Fire/P/INS55433/&from=86902
179
+ </url>
180
+ <artist_name>Arcade Fire</artist_name>
181
+ <title>Funeral</title>
182
+ <format>MP3</format>
183
+ <product_id>INS55433</product_id>
184
+ </product>
185
+ <product>
186
+ <url>
187
+ http://www.insound.com/July-12-2010-Show-Poster-poster-Arcade-Fire/P/INS80896/&from=86902
188
+ </url>
189
+ <artist_name>Arcade Fire</artist_name>
190
+ <title>July 12, 2010 Show Poster</title>
191
+ <format>Poster</format>
192
+ <product_id>INS80896</product_id>
193
+ </product>
194
+ <product>
195
+ <url>
196
+ http://www.insound.com/September-21-and-22-2011-Show-Poster-poster-Arcade-Fire/P/INS106729/&from=86902
197
+ </url>
198
+ <artist_name>Arcade Fire</artist_name>
199
+ <title>September 21 and 22, 2011 Show Poster</title>
200
+ <format>Poster</format>
201
+ <product_id>INS106729</product_id>
202
+ </product>
203
+ <product>
204
+ <url>
205
+ http://www.insound.com/Spring-Tour-2011-4-Tennessee-and-Texas-poster-Arcade-Fire/P/INS95616/&from=86902
206
+ </url>
207
+ <artist_name>Arcade Fire</artist_name>
208
+ <title>Spring Tour 2011 #4 (Tennessee and Texas)</title>
209
+ <format>Poster</format>
210
+ <product_id>INS95616</product_id>
211
+ </product>
212
+ <product>
213
+ <url>
214
+ http://www.insound.com/Europe-Tour-2011-poster-Arcade-Fire/P/INS98764/&from=86902
215
+ </url>
216
+ <artist_name>Arcade Fire</artist_name>
217
+ <title>Europe Tour 2011</title>
218
+ <format>Poster</format>
219
+ <product_id>INS98764</product_id>
220
+ </product>
221
+ <product>
222
+ <url>
223
+ http://www.insound.com/The-Suburbs-Deluxe-MP3-Arcade-Fire/P/INS98280/&from=86902
224
+ </url>
225
+ <artist_name>Arcade Fire</artist_name>
226
+ <title>The Suburbs Deluxe</title>
227
+ <format>MP3</format>
228
+ <product_id>INS98280</product_id>
229
+ </product>
230
+ <product>
231
+ <url>
232
+ http://www.insound.com/Solo-Singles-Series-7-Vinyl-7inch-Trance-and-The-Arcade/P/INS17162/&from=86902
233
+ </url>
234
+ <artist_name>Trance and The Arcade</artist_name>
235
+ <title>Solo Singles Series 7</title>
236
+ <format>Vinyl 7&quot;</format>
237
+ <product_id>INS17162</product_id>
238
+ </product>
239
+ <product>
240
+ <url>
241
+ http://www.insound.com/Neon-Bible-MP3-Arcade-Fire/P/INS55434/&from=86902
242
+ </url>
243
+ <artist_name>Arcade Fire</artist_name>
244
+ <title>Neon Bible</title>
245
+ <format>MP3</format>
246
+ <product_id>INS55434</product_id>
247
+ </product>
248
+ <product>
249
+ <url>
250
+ http://www.insound.com/Canadian-Tour-September-2010-Show-Poster-poster-Arcade-Fire/P/INS89256/&from=86902
251
+ </url>
252
+ <artist_name>Arcade Fire</artist_name>
253
+ <title>Canadian Tour, September 2010 Show Poster</title>
254
+ <format>Poster</format>
255
+ <product_id>INS89256</product_id>
256
+ </product>
257
+ <product>
258
+ <url>
259
+ http://www.insound.com/December-8-12-2010-Show-Poster-poster-Arcade-Fire/P/INS90081/&from=86902
260
+ </url>
261
+ <artist_name>Arcade Fire</artist_name>
262
+ <title>December 8-12, 2010 Show Poster</title>
263
+ <format>Poster</format>
264
+ <product_id>INS90081</product_id>
265
+ </product>
266
+ <product>
267
+ <url>
268
+ http://www.insound.com/The-String-Quartet-Tribute-to-Arcade-Fires-Funereal-MP3-Arcade-Fire-String-Quartet-Tribute/P/INS39454/&from=86902
269
+ </url>
270
+ <artist_name>Arcade Fire String Quartet Tribute</artist_name>
271
+ <title>
272
+ The String Quartet Tribute to Arcade Fire's Funereal
273
+ </title>
274
+ <format>MP3</format>
275
+ <product_id>INS39454</product_id>
276
+ </product>
277
+ </product_matches>
278
+ <artist_matches>
279
+ <artist>
280
+ <artist_name>Arcade Fire</artist_name>
281
+ <url>
282
+ http://www.insound.com/Arcade-Fire/A/29908/&from=86902
283
+ </url>
284
+ <artist_id>29908</artist_id>
285
+ </artist>
286
+ <artist>
287
+ <artist_name>Arcade Fire String Quartet Tribute</artist_name>
288
+ <url>
289
+ http://www.insound.com/Arcade-Fire-String-Quartet-Tribute/A/34443/&from=86902
290
+ </url>
291
+ <artist_id>34443</artist_id>
292
+ </artist>
293
+ <artist>
294
+ <artist_name>Deep Sea Arcade</artist_name>
295
+ <url>
296
+ http://www.insound.com/Deep-Sea-Arcade/A/51254/&from=86902
297
+ </url>
298
+ <artist_id>51254</artist_id>
299
+ </artist>
300
+ <artist>
301
+ <artist_name>Flashlight Arcade</artist_name>
302
+ <url>
303
+ http://www.insound.com/Flashlight-Arcade/A/30088/&from=86902
304
+ </url>
305
+ <artist_id>30088</artist_id>
306
+ </artist>
307
+ <artist>
308
+ <artist_name>LCD Soundsystem / Arcade Fire</artist_name>
309
+ <url>
310
+ http://www.insound.com/LCD-Soundsystem-Arcade-Fire/A/34698/&from=86902
311
+ </url>
312
+ <artist_id>34698</artist_id>
313
+ </artist>
314
+ <artist>
315
+ <artist_name>LCD Soundsystem/Arcade Fire</artist_name>
316
+ <url>
317
+ http://www.insound.com/LCD-SoundsystemArcade-Fire/A/38758/&from=86902
318
+ </url>
319
+ <artist_id>38758</artist_id>
320
+ </artist>
321
+ <artist>
322
+ <artist_name>Trance and The Arcade</artist_name>
323
+ <url>
324
+ http://www.insound.com/Trance-and-The-Arcade/A/20727/&from=86902
325
+ </url>
326
+ <artist_id>20727</artist_id>
327
+ </artist>
328
+ </artist_matches>
329
+ <total_results>37</total_results>
330
+ <total_product_results>30</total_product_results>
331
+ <total_artist_results>7</total_artist_results>
332
+ </insound_query_response>