insound_api 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +23 -3
- data/VERSION +1 -1
- data/insound_api.gemspec +1 -2
- data/lib/insound_api.rb +0 -1
- data/lib/insound_api/artist.rb +6 -11
- data/lib/insound_api/product.rb +9 -9
- data/lib/insound_api/results.rb +13 -38
- data/test/query_test.rb +10 -10
- data/test/webmock/jimmy_eat_world_vinyl.xml +36 -43
- data/test/webmock/maxresults.xml +256 -331
- data/test/webmock/no_results_found.xml +10 -11
- data/test/webmock/zen_arcade.xml +30 -35
- metadata +2 -3
- data/lib/insound_api/object_base.rb +0 -27
data/README.md
CHANGED
@@ -7,7 +7,6 @@
|
|
7
7
|
A ruby gem for accessing the [insound.com Web Service API for affiliates][api_docs].
|
8
8
|
|
9
9
|
|
10
|
-
|
11
10
|
## Install
|
12
11
|
|
13
12
|
``` ruby
|
@@ -18,19 +17,40 @@ gem 'insound_api'
|
|
18
17
|
bundle install
|
19
18
|
```
|
20
19
|
|
21
|
-
##
|
20
|
+
## Setup
|
22
21
|
|
23
22
|
You will need to setup insound_api to use your credentials. If you are using rails, a good place to do this is in a initializer:
|
24
23
|
|
25
24
|
``` ruby
|
26
25
|
# /config/initializers/insound_api.rb
|
27
|
-
|
28
26
|
InsoundApi.setup do |config|
|
29
27
|
config.affiliate_id = 42
|
30
28
|
config.api_password = 'my_password'
|
31
29
|
end
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage
|
32
33
|
|
34
|
+
Currently the API only supports searches and you must provide an artist param. There are some optional params (title, maxresults, format) you can find in their [API Doc][api_docs]. The results contain some metadata about the search as well as two arrays of resulting products and artists:
|
35
|
+
|
36
|
+
``` ruby
|
37
|
+
results = InsoundApi.search(:artist => "Nofx", :maxresults => 50)
|
38
|
+
results.artists_total
|
39
|
+
=> 1
|
40
|
+
results.products_total
|
41
|
+
=> 36
|
42
|
+
artist = results.artists.first
|
43
|
+
artist.name
|
44
|
+
=> "NOFX"
|
45
|
+
product = results.products.first
|
46
|
+
product.title
|
47
|
+
=> "I Heard They Suck Live!"
|
33
48
|
```
|
34
49
|
|
50
|
+
Products have the following attributes: url, id, title, artist_name, format
|
51
|
+
|
52
|
+
and Artists have: url, id, name
|
53
|
+
|
54
|
+
|
35
55
|
|
36
56
|
[api_docs]: https://www.insound.com/affiliate/webservices.php
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/insound_api.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "insound_api"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Zachary Kloepping"]
|
@@ -27,7 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
"lib/insound_api.rb",
|
28
28
|
"lib/insound_api/artist.rb",
|
29
29
|
"lib/insound_api/config.rb",
|
30
|
-
"lib/insound_api/object_base.rb",
|
31
30
|
"lib/insound_api/product.rb",
|
32
31
|
"lib/insound_api/query.rb",
|
33
32
|
"lib/insound_api/request.rb",
|
data/lib/insound_api.rb
CHANGED
data/lib/insound_api/artist.rb
CHANGED
@@ -1,18 +1,13 @@
|
|
1
1
|
module InsoundApi
|
2
|
-
class Artist
|
2
|
+
class Artist
|
3
3
|
|
4
|
-
|
5
|
-
@name ||= parse_str('artist_name')
|
6
|
-
end
|
7
|
-
|
8
|
-
def format
|
9
|
-
@format ||= parse_str('format')
|
10
|
-
end
|
4
|
+
attr_reader :url, :id, :name
|
11
5
|
|
12
|
-
def
|
13
|
-
@
|
6
|
+
def initialize(node)
|
7
|
+
@url = Results.parse_str('url', node)
|
8
|
+
@name = Results.parse_str('artist_name', node)
|
9
|
+
@id = Results.parse_int('artist_id', node)
|
14
10
|
end
|
15
11
|
|
16
|
-
|
17
12
|
end
|
18
13
|
end
|
data/lib/insound_api/product.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
module InsoundApi
|
2
|
-
class Product
|
2
|
+
class Product
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
end
|
4
|
+
attr_reader :url, :id, :title
|
5
|
+
attr_reader :artist_name, :format
|
7
6
|
|
8
|
-
def format
|
9
|
-
@format ||= parse_str('format')
|
10
|
-
end
|
11
7
|
|
12
|
-
def
|
13
|
-
@
|
8
|
+
def initialize(node)
|
9
|
+
@url = Results.parse_str('url', node)
|
10
|
+
@id = Results.parse_str('product_id', node)
|
11
|
+
@title = Results.parse_str('title', node)
|
12
|
+
@artist_name = Results.parse_str('artist_name', node)
|
13
|
+
@format = Results.parse_str('format', node)
|
14
14
|
end
|
15
15
|
|
16
16
|
end
|
data/lib/insound_api/results.rb
CHANGED
@@ -1,66 +1,41 @@
|
|
1
1
|
module InsoundApi
|
2
2
|
class Results
|
3
3
|
|
4
|
-
attr_reader :
|
4
|
+
attr_reader :search_url, :total_results
|
5
|
+
attr_reader :products, :products_total
|
6
|
+
attr_reader :artists, :artists_total
|
5
7
|
|
6
8
|
# takes a nokogiri document
|
7
|
-
def initialize(
|
8
|
-
@
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@
|
13
|
-
|
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')
|
9
|
+
def initialize(doc)
|
10
|
+
@search_url = Results.parse_str('search_url', doc)
|
11
|
+
@products = Results.parse_objects('product_matches product', Product, doc)
|
12
|
+
@products_total = Results.parse_int('total_product_results', doc)
|
13
|
+
@artists = Results.parse_objects('artist_matches artist', Artist, doc)
|
14
|
+
@artists_total = Results.parse_int('total_artist_results', doc)
|
15
|
+
@total_results = Results.parse_int('total_results', doc)
|
33
16
|
end
|
34
17
|
|
35
18
|
|
36
|
-
|
37
|
-
def parse_objects(selector, klass)
|
19
|
+
def self.parse_objects(selector, klass, doc)
|
38
20
|
nodes = doc.css(selector)
|
39
21
|
nodes.map{|n| klass.new(n) }
|
40
22
|
end
|
41
23
|
|
42
24
|
|
43
|
-
def parse_int(selector)
|
44
|
-
Results.parse_int(selector, doc)
|
45
|
-
end
|
46
|
-
|
47
25
|
def self.parse_int(selector, doc)
|
48
26
|
nodes = doc.css(selector)
|
49
27
|
if nodes.any?
|
50
|
-
nodes.first.
|
28
|
+
nodes.first.inner_text.strip.to_i
|
51
29
|
else
|
52
30
|
0
|
53
31
|
end
|
54
32
|
end
|
55
33
|
|
56
|
-
def parse_str(selector)
|
57
|
-
Results.parse_str(selector, doc)
|
58
|
-
end
|
59
34
|
|
60
35
|
def self.parse_str(selector, doc)
|
61
36
|
nodes = doc.css(selector)
|
62
37
|
if nodes.any?
|
63
|
-
nodes.first.
|
38
|
+
nodes.first.inner_text.strip
|
64
39
|
end
|
65
40
|
end
|
66
41
|
|
data/test/query_test.rb
CHANGED
@@ -8,8 +8,6 @@ module InsoundApi
|
|
8
8
|
setup_credentials
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
11
|
context 'search by artist returning no results' do
|
14
12
|
setup do
|
15
13
|
mock(:no_results_found, "?artist=xxcxccxcx")
|
@@ -23,7 +21,8 @@ module InsoundApi
|
|
23
21
|
assert_equal 0, @results.products_total
|
24
22
|
assert_equal 0, @results.artists_total
|
25
23
|
assert_equal 0, @results.total_results
|
26
|
-
|
24
|
+
|
25
|
+
assert @results.search_url.include?("http://www.insound.com/search/?query=xxcxccxcx&from=")
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
@@ -40,7 +39,7 @@ module InsoundApi
|
|
40
39
|
assert_equal 0, @results.products_total
|
41
40
|
assert_equal 0, @results.artists_total
|
42
41
|
assert_equal 0, @results.total_results
|
43
|
-
assert @results.search_url
|
42
|
+
assert @results.search_url.include?("http://www.insound.com/search/?query=xxcxccxcx&from=")
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
@@ -60,14 +59,14 @@ module InsoundApi
|
|
60
59
|
assert_nil @results.search_url
|
61
60
|
|
62
61
|
product = @results.products.first
|
63
|
-
assert product.url
|
62
|
+
assert product.url.include?("http://www.insound.com/Invented-Vinyl-LP-Jimmy-Eat-World/P/INS79668/&from=")
|
64
63
|
assert_equal 'Jimmy Eat World', product.artist_name
|
65
64
|
assert_equal 'Invented', product.title
|
66
65
|
assert_equal 'Vinyl LP', product.format
|
67
66
|
assert_equal 'INS79668', product.id
|
68
67
|
|
69
68
|
artist = @results.artists.first
|
70
|
-
assert artist.url
|
69
|
+
assert artist.url.include?("http://www.insound.com/Jimmy-Eat-World/A/19191/&from=")
|
71
70
|
assert_equal 'Jimmy Eat World', artist.name
|
72
71
|
assert_equal 19191, artist.id
|
73
72
|
end
|
@@ -89,14 +88,14 @@ module InsoundApi
|
|
89
88
|
assert_nil @results.search_url
|
90
89
|
|
91
90
|
product = @results.products.first
|
92
|
-
assert product.url
|
91
|
+
assert product.url.include?("http://www.insound.com/Funeral-CD-Arcade-Fire/P/INS23877/&from=")
|
93
92
|
assert_equal 'Arcade Fire', product.artist_name
|
94
93
|
assert_equal 'Funeral', product.title
|
95
94
|
assert_equal 'CD', product.format
|
96
95
|
assert_equal 'INS23877', product.id
|
97
96
|
|
98
97
|
artist = @results.artists.first
|
99
|
-
assert artist.url
|
98
|
+
assert artist.url.include?("http://www.insound.com/Arcade-Fire/A/29908/&from=")
|
100
99
|
assert_equal 'Arcade Fire', artist.name
|
101
100
|
assert_equal 29908, artist.id
|
102
101
|
end
|
@@ -119,14 +118,15 @@ module InsoundApi
|
|
119
118
|
assert_nil @results.search_url
|
120
119
|
|
121
120
|
product = @results.products.first
|
122
|
-
|
121
|
+
|
122
|
+
assert product.url.include?("http://www.insound.com/Zen-Arcade-Vinyl-LP-Husker-Du/P/INS13241/&from=")
|
123
123
|
assert_equal 'Husker Du', product.artist_name
|
124
124
|
assert_equal 'Zen Arcade', product.title
|
125
125
|
assert_equal 'Vinyl LP', product.format
|
126
126
|
assert_equal 'INS13241', product.id
|
127
127
|
|
128
128
|
artist = @results.artists.first
|
129
|
-
assert artist.url
|
129
|
+
assert artist.url.include?("http://www.insound.com/Husker-Du/A/21544/&from=")
|
130
130
|
assert_equal 'Husker Du', artist.name
|
131
131
|
assert_equal 21544, artist.id
|
132
132
|
end
|
@@ -1,45 +1,38 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
1
2
|
<insound_query_response>
|
2
|
-
<warnings
|
3
|
-
<errors
|
4
|
-
<product_matches>
|
5
|
-
<product>
|
6
|
-
<url>
|
7
|
-
|
8
|
-
</
|
9
|
-
<
|
10
|
-
<
|
11
|
-
|
12
|
-
<
|
13
|
-
</
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
</
|
18
|
-
|
19
|
-
<
|
20
|
-
<
|
21
|
-
<
|
22
|
-
</
|
23
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
</
|
27
|
-
<
|
28
|
-
<
|
29
|
-
<
|
30
|
-
<
|
31
|
-
</
|
32
|
-
</
|
33
|
-
|
34
|
-
<
|
35
|
-
<
|
36
|
-
<
|
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>
|
3
|
+
<warnings></warnings>
|
4
|
+
<errors></errors>
|
5
|
+
<product_matches>
|
6
|
+
<product>
|
7
|
+
<url>http://www.insound.com/Invented-Vinyl-LP-Jimmy-Eat-World/P/INS79668/&from=86902</url>
|
8
|
+
<artist_name>Jimmy Eat World</artist_name>
|
9
|
+
<title>Invented</title>
|
10
|
+
<format>Vinyl LP</format>
|
11
|
+
<product_id>INS79668</product_id>
|
12
|
+
</product>
|
13
|
+
<product>
|
14
|
+
<url>http://www.insound.com/Chase-This-Light-Vinyl-LP-Jimmy-Eat-World/P/INS39744/&from=86902</url>
|
15
|
+
<artist_name>Jimmy Eat World</artist_name>
|
16
|
+
<title>Chase This Light</title>
|
17
|
+
<format>Vinyl LP</format>
|
18
|
+
<product_id>INS39744</product_id>
|
19
|
+
</product>
|
20
|
+
<product>
|
21
|
+
<url>http://www.insound.com/Bleed-American-Vinyl-3xLP-Jimmy-Eat-World/P/INS111472/&from=86902</url>
|
22
|
+
<artist_name>Jimmy Eat World</artist_name>
|
23
|
+
<title>Bleed American</title>
|
24
|
+
<format>Vinyl 3xLP</format>
|
25
|
+
<product_id>INS111472</product_id>
|
26
|
+
</product>
|
27
|
+
</product_matches>
|
28
|
+
<artist_matches>
|
29
|
+
<artist>
|
30
|
+
<artist_name>Jimmy Eat World</artist_name>
|
31
|
+
<url>http://www.insound.com/Jimmy-Eat-World/A/19191/&from=86902</url>
|
32
|
+
<artist_id>19191</artist_id>
|
33
|
+
</artist>
|
34
|
+
</artist_matches>
|
35
|
+
<total_results>4</total_results>
|
36
|
+
<total_product_results>3</total_product_results>
|
37
|
+
<total_artist_results>1</total_artist_results>
|
45
38
|
</insound_query_response>
|
data/test/webmock/maxresults.xml
CHANGED
@@ -1,332 +1,257 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
1
2
|
<insound_query_response>
|
2
|
-
<warnings
|
3
|
-
<errors
|
4
|
-
<product_matches>
|
5
|
-
<product>
|
6
|
-
<url>
|
7
|
-
|
8
|
-
</
|
9
|
-
<
|
10
|
-
<
|
11
|
-
|
12
|
-
<
|
13
|
-
</
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
</
|
18
|
-
|
19
|
-
<
|
20
|
-
<
|
21
|
-
<
|
22
|
-
</
|
23
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
<
|
28
|
-
<
|
29
|
-
<
|
30
|
-
<
|
31
|
-
</
|
32
|
-
|
33
|
-
<
|
34
|
-
http://www.insound.com/Neon-Bible-CD-Arcade-Fire/P/
|
35
|
-
</
|
36
|
-
<
|
37
|
-
<
|
38
|
-
<
|
39
|
-
|
40
|
-
|
41
|
-
<
|
42
|
-
<
|
43
|
-
|
44
|
-
</
|
45
|
-
<
|
46
|
-
|
47
|
-
<
|
48
|
-
<
|
49
|
-
</
|
50
|
-
<
|
51
|
-
<
|
52
|
-
|
53
|
-
</
|
54
|
-
<
|
55
|
-
<
|
56
|
-
<
|
57
|
-
<
|
58
|
-
</
|
59
|
-
<
|
60
|
-
|
61
|
-
|
62
|
-
</url>
|
63
|
-
<artist_name>Arcade Fire</artist_name>
|
64
|
-
<title>
|
65
|
-
<format>
|
66
|
-
<product_id>
|
67
|
-
</product>
|
68
|
-
<product>
|
69
|
-
<url>
|
70
|
-
|
71
|
-
</
|
72
|
-
<
|
73
|
-
<
|
74
|
-
|
75
|
-
<
|
76
|
-
</
|
77
|
-
<
|
78
|
-
<
|
79
|
-
|
80
|
-
</
|
81
|
-
|
82
|
-
<
|
83
|
-
<
|
84
|
-
<
|
85
|
-
</
|
86
|
-
<
|
87
|
-
<
|
88
|
-
|
89
|
-
|
90
|
-
<
|
91
|
-
<
|
92
|
-
<
|
93
|
-
<
|
94
|
-
</
|
95
|
-
|
96
|
-
<
|
97
|
-
http://www.insound.com/
|
98
|
-
</
|
99
|
-
<
|
100
|
-
<
|
101
|
-
<
|
102
|
-
|
103
|
-
|
104
|
-
<
|
105
|
-
<
|
106
|
-
|
107
|
-
</
|
108
|
-
<
|
109
|
-
|
110
|
-
<
|
111
|
-
<
|
112
|
-
</
|
113
|
-
<
|
114
|
-
<
|
115
|
-
|
116
|
-
</
|
117
|
-
<
|
118
|
-
<
|
119
|
-
<
|
120
|
-
<
|
121
|
-
</
|
122
|
-
<
|
123
|
-
|
124
|
-
|
125
|
-
</url>
|
126
|
-
<artist_name>Arcade Fire</artist_name>
|
127
|
-
<title>
|
128
|
-
<format>
|
129
|
-
<product_id>
|
130
|
-
</product>
|
131
|
-
<product>
|
132
|
-
<url>
|
133
|
-
|
134
|
-
</
|
135
|
-
<
|
136
|
-
<
|
137
|
-
|
138
|
-
<
|
139
|
-
</
|
140
|
-
<
|
141
|
-
<
|
142
|
-
|
143
|
-
</
|
144
|
-
|
145
|
-
<
|
146
|
-
<
|
147
|
-
<
|
148
|
-
</
|
149
|
-
<
|
150
|
-
<
|
151
|
-
|
152
|
-
|
153
|
-
<
|
154
|
-
<
|
155
|
-
<
|
156
|
-
<
|
157
|
-
</
|
158
|
-
|
159
|
-
<
|
160
|
-
http://www.insound.com/
|
161
|
-
</
|
162
|
-
<
|
163
|
-
<
|
164
|
-
<
|
165
|
-
|
166
|
-
|
167
|
-
<
|
168
|
-
<
|
169
|
-
|
170
|
-
</
|
171
|
-
<
|
172
|
-
|
173
|
-
<
|
174
|
-
<
|
175
|
-
</
|
176
|
-
<
|
177
|
-
<
|
178
|
-
|
179
|
-
</
|
180
|
-
<
|
181
|
-
<
|
182
|
-
<
|
183
|
-
<
|
184
|
-
|
185
|
-
<
|
186
|
-
|
187
|
-
|
188
|
-
</url>
|
189
|
-
<artist_name>Arcade Fire</artist_name>
|
190
|
-
<title>
|
191
|
-
<format>
|
192
|
-
<product_id>
|
193
|
-
</product>
|
194
|
-
<product>
|
195
|
-
<url>
|
196
|
-
|
197
|
-
</
|
198
|
-
<
|
199
|
-
<
|
200
|
-
|
201
|
-
<
|
202
|
-
</
|
203
|
-
<
|
204
|
-
<
|
205
|
-
|
206
|
-
</
|
207
|
-
|
208
|
-
<
|
209
|
-
<
|
210
|
-
<
|
211
|
-
</
|
212
|
-
<
|
213
|
-
<
|
214
|
-
|
215
|
-
</
|
216
|
-
<
|
217
|
-
<
|
218
|
-
<
|
219
|
-
<
|
220
|
-
</
|
221
|
-
|
222
|
-
<
|
223
|
-
|
224
|
-
</url>
|
225
|
-
<
|
226
|
-
|
227
|
-
<
|
228
|
-
<
|
229
|
-
</
|
230
|
-
<
|
231
|
-
|
232
|
-
|
233
|
-
</
|
234
|
-
<
|
235
|
-
<
|
236
|
-
|
237
|
-
<
|
238
|
-
</
|
239
|
-
<
|
240
|
-
<
|
241
|
-
|
242
|
-
|
243
|
-
<artist_name>Arcade Fire</artist_name>
|
244
|
-
<
|
245
|
-
<
|
246
|
-
|
247
|
-
|
248
|
-
<
|
249
|
-
<url>
|
250
|
-
|
251
|
-
</
|
252
|
-
|
253
|
-
<
|
254
|
-
<
|
255
|
-
<
|
256
|
-
</
|
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>
|
3
|
+
<warnings></warnings>
|
4
|
+
<errors></errors>
|
5
|
+
<product_matches>
|
6
|
+
<product>
|
7
|
+
<url>http://www.insound.com/Funeral-CD-Arcade-Fire/P/INS23877/&from=86902</url>
|
8
|
+
<artist_name>Arcade Fire</artist_name>
|
9
|
+
<title>Funeral </title>
|
10
|
+
<format>CD</format>
|
11
|
+
<product_id>INS23877</product_id>
|
12
|
+
</product>
|
13
|
+
<product>
|
14
|
+
<url>http://www.insound.com/The-Suburbs-Vinyl-2xLP-Arcade-Fire/P/INS76692/&from=86902</url>
|
15
|
+
<artist_name>Arcade Fire</artist_name>
|
16
|
+
<title>The Suburbs</title>
|
17
|
+
<format>Vinyl 2xLP</format>
|
18
|
+
<product_id>INS76692</product_id>
|
19
|
+
</product>
|
20
|
+
<product>
|
21
|
+
<url>http://www.insound.com/Neon-Bible-Vinyl-LP-Arcade-Fire/P/INS33679/&from=86902</url>
|
22
|
+
<artist_name>Arcade Fire</artist_name>
|
23
|
+
<title>Neon Bible</title>
|
24
|
+
<format>Vinyl LP</format>
|
25
|
+
<product_id>INS33679</product_id>
|
26
|
+
</product>
|
27
|
+
<product>
|
28
|
+
<url>http://www.insound.com/Neon-Bible-CD-Arcade-Fire/P/INS33678/&from=86902</url>
|
29
|
+
<artist_name>Arcade Fire</artist_name>
|
30
|
+
<title>Neon Bible</title>
|
31
|
+
<format>CD</format>
|
32
|
+
<product_id>INS33678</product_id>
|
33
|
+
</product>
|
34
|
+
<product>
|
35
|
+
<url>http://www.insound.com/Neon-Bible-Deluxe-Edition-CD-Arcade-Fire/P/INS33683/&from=86902</url>
|
36
|
+
<artist_name>Arcade Fire</artist_name>
|
37
|
+
<title>Neon Bible (Deluxe Edition)</title>
|
38
|
+
<format>CD</format>
|
39
|
+
<product_id>INS33683</product_id>
|
40
|
+
</product>
|
41
|
+
<product>
|
42
|
+
<url>http://www.insound.com/Funeral-Reissue-Vinyl-LP-Arcade-Fire/P/INS70891/&from=86902</url>
|
43
|
+
<artist_name>Arcade Fire</artist_name>
|
44
|
+
<title>Funeral (Reissue)</title>
|
45
|
+
<format>Vinyl LP</format>
|
46
|
+
<product_id>INS70891</product_id>
|
47
|
+
</product>
|
48
|
+
<product>
|
49
|
+
<url>http://www.insound.com/Arcade-Fire-CDep-Arcade-Fire/P/INS26865/&from=86902</url>
|
50
|
+
<artist_name>Arcade Fire</artist_name>
|
51
|
+
<title>Arcade Fire </title>
|
52
|
+
<format>CDep</format>
|
53
|
+
<product_id>INS26865</product_id>
|
54
|
+
</product>
|
55
|
+
<product>
|
56
|
+
<url>http://www.insound.com/May-29-30-2007-Show-Poster-poster-Arcade-Fire/P/INS36391/&from=86902</url>
|
57
|
+
<artist_name>Arcade Fire</artist_name>
|
58
|
+
<title>May 29 & 30, 2007 Show Poster</title>
|
59
|
+
<format>Poster</format>
|
60
|
+
<product_id>INS36391</product_id>
|
61
|
+
</product>
|
62
|
+
<product>
|
63
|
+
<url>http://www.insound.com/The-Suburbs-CD-Arcade-Fire/P/INS76693/&from=86902</url>
|
64
|
+
<artist_name>Arcade Fire</artist_name>
|
65
|
+
<title>The Suburbs</title>
|
66
|
+
<format>CD</format>
|
67
|
+
<product_id>INS76693</product_id>
|
68
|
+
</product>
|
69
|
+
<product>
|
70
|
+
<url>http://www.insound.com/Miroir-Noir-Deluxe-Edition-2xDVD-Arcade-Fire/P/INS54522/&from=86902</url>
|
71
|
+
<artist_name>Arcade Fire</artist_name>
|
72
|
+
<title>Miroir Noir (Deluxe Edition)</title>
|
73
|
+
<format>2xDVD</format>
|
74
|
+
<product_id>INS54522</product_id>
|
75
|
+
</product>
|
76
|
+
<product>
|
77
|
+
<url>http://www.insound.com/The-Suburbs-MP3-Arcade-Fire/P/INS78922/&from=86902</url>
|
78
|
+
<artist_name>Arcade Fire</artist_name>
|
79
|
+
<title>The Suburbs</title>
|
80
|
+
<format>MP3</format>
|
81
|
+
<product_id>INS78922</product_id>
|
82
|
+
</product>
|
83
|
+
<product>
|
84
|
+
<url>http://www.insound.com/The-Suburbs-Deluxe-Edition-CD-and-DVD-Arcade-Fire/P/INS96835/&from=86902</url>
|
85
|
+
<artist_name>Arcade Fire</artist_name>
|
86
|
+
<title>The Suburbs (Deluxe Edition)</title>
|
87
|
+
<format>CD+DVD</format>
|
88
|
+
<product_id>INS96835</product_id>
|
89
|
+
</product>
|
90
|
+
<product>
|
91
|
+
<url>http://www.insound.com/Outlands-Vinyl-LP-Deep-Sea-Arcade/P/INS108373/&from=86902</url>
|
92
|
+
<artist_name>Deep Sea Arcade</artist_name>
|
93
|
+
<title>Outlands</title>
|
94
|
+
<format>Vinyl LP</format>
|
95
|
+
<product_id>INS108373</product_id>
|
96
|
+
</product>
|
97
|
+
<product>
|
98
|
+
<url>http://www.insound.com/Power-Out-CDep-Arcade-Fire/P/INS26778/&from=86902</url>
|
99
|
+
<artist_name>Arcade Fire</artist_name>
|
100
|
+
<title>Power Out</title>
|
101
|
+
<format>CDep</format>
|
102
|
+
<product_id>INS26778</product_id>
|
103
|
+
</product>
|
104
|
+
<product>
|
105
|
+
<url>http://www.insound.com/Spring-Tour-2011-3-Chicago-poster-Arcade-Fire/P/INS95618/&from=86902</url>
|
106
|
+
<artist_name>Arcade Fire</artist_name>
|
107
|
+
<title>Spring Tour 2011 #3 (Chicago)</title>
|
108
|
+
<format>Poster</format>
|
109
|
+
<product_id>INS95618</product_id>
|
110
|
+
</product>
|
111
|
+
<product>
|
112
|
+
<url>http://www.insound.com/Miroir-Noir-DVD-Arcade-Fire/P/INS54521/&from=86902</url>
|
113
|
+
<artist_name>Arcade Fire</artist_name>
|
114
|
+
<title>Miroir Noir</title>
|
115
|
+
<format>DVD</format>
|
116
|
+
<product_id>INS54521</product_id>
|
117
|
+
</product>
|
118
|
+
<product>
|
119
|
+
<url>http://www.insound.com/December-5-6-2010-Show-Poster-poster-Arcade-Fire/P/INS90082/&from=86902</url>
|
120
|
+
<artist_name>Arcade Fire</artist_name>
|
121
|
+
<title>December 5-6, 2010 Show Poster</title>
|
122
|
+
<format>Poster</format>
|
123
|
+
<product_id>INS90082</product_id>
|
124
|
+
</product>
|
125
|
+
<product>
|
126
|
+
<url>http://www.insound.com/June-30-2011-Show-Poster-poster-Arcade-Fire/P/INS98765/&from=86902</url>
|
127
|
+
<artist_name>Arcade Fire</artist_name>
|
128
|
+
<title>June 30, 2011 Show Poster</title>
|
129
|
+
<format>Poster</format>
|
130
|
+
<product_id>INS98765</product_id>
|
131
|
+
</product>
|
132
|
+
<product>
|
133
|
+
<url>http://www.insound.com/Spring-Tour-2011-1-West-Coast-poster-Arcade-Fire/P/INS95619/&from=86902</url>
|
134
|
+
<artist_name>Arcade Fire</artist_name>
|
135
|
+
<title>Spring Tour 2011 #1 (West Coast)</title>
|
136
|
+
<format>Poster</format>
|
137
|
+
<product_id>INS95619</product_id>
|
138
|
+
</product>
|
139
|
+
<product>
|
140
|
+
<url>http://www.insound.com/Funeral-MP3-Arcade-Fire/P/INS55433/&from=86902</url>
|
141
|
+
<artist_name>Arcade Fire</artist_name>
|
142
|
+
<title>Funeral</title>
|
143
|
+
<format>MP3</format>
|
144
|
+
<product_id>INS55433</product_id>
|
145
|
+
</product>
|
146
|
+
<product>
|
147
|
+
<url>http://www.insound.com/July-12-2010-Show-Poster-poster-Arcade-Fire/P/INS80896/&from=86902</url>
|
148
|
+
<artist_name>Arcade Fire</artist_name>
|
149
|
+
<title>July 12, 2010 Show Poster</title>
|
150
|
+
<format>Poster</format>
|
151
|
+
<product_id>INS80896</product_id>
|
152
|
+
</product>
|
153
|
+
<product>
|
154
|
+
<url>http://www.insound.com/September-21-and-22-2011-Show-Poster-poster-Arcade-Fire/P/INS106729/&from=86902</url>
|
155
|
+
<artist_name>Arcade Fire</artist_name>
|
156
|
+
<title>September 21 and 22, 2011 Show Poster</title>
|
157
|
+
<format>Poster</format>
|
158
|
+
<product_id>INS106729</product_id>
|
159
|
+
</product>
|
160
|
+
<product>
|
161
|
+
<url>http://www.insound.com/Spring-Tour-2011-4-Tennessee-and-Texas-poster-Arcade-Fire/P/INS95616/&from=86902</url>
|
162
|
+
<artist_name>Arcade Fire</artist_name>
|
163
|
+
<title>Spring Tour 2011 #4 (Tennessee and Texas)</title>
|
164
|
+
<format>Poster</format>
|
165
|
+
<product_id>INS95616</product_id>
|
166
|
+
</product>
|
167
|
+
<product>
|
168
|
+
<url>http://www.insound.com/Europe-Tour-2011-poster-Arcade-Fire/P/INS98764/&from=86902</url>
|
169
|
+
<artist_name>Arcade Fire</artist_name>
|
170
|
+
<title>Europe Tour 2011</title>
|
171
|
+
<format>Poster</format>
|
172
|
+
<product_id>INS98764</product_id>
|
173
|
+
</product>
|
174
|
+
<product>
|
175
|
+
<url>http://www.insound.com/The-Suburbs-Deluxe-MP3-Arcade-Fire/P/INS98280/&from=86902</url>
|
176
|
+
<artist_name>Arcade Fire</artist_name>
|
177
|
+
<title>The Suburbs Deluxe</title>
|
178
|
+
<format>MP3</format>
|
179
|
+
<product_id>INS98280</product_id>
|
180
|
+
</product>
|
181
|
+
<product>
|
182
|
+
<url>http://www.insound.com/Solo-Singles-Series-7-Vinyl-7inch-Trance-and-The-Arcade/P/INS17162/&from=86902</url>
|
183
|
+
<artist_name>Trance and The Arcade</artist_name>
|
184
|
+
<title>Solo Singles Series 7</title>
|
185
|
+
<format>Vinyl 7&quot;</format>
|
186
|
+
<product_id>INS17162</product_id>
|
187
|
+
</product>
|
188
|
+
<product>
|
189
|
+
<url>http://www.insound.com/Neon-Bible-MP3-Arcade-Fire/P/INS55434/&from=86902</url>
|
190
|
+
<artist_name>Arcade Fire</artist_name>
|
191
|
+
<title>Neon Bible</title>
|
192
|
+
<format>MP3</format>
|
193
|
+
<product_id>INS55434</product_id>
|
194
|
+
</product>
|
195
|
+
<product>
|
196
|
+
<url>http://www.insound.com/Canadian-Tour-September-2010-Show-Poster-poster-Arcade-Fire/P/INS89256/&from=86902</url>
|
197
|
+
<artist_name>Arcade Fire</artist_name>
|
198
|
+
<title>Canadian Tour, September 2010 Show Poster</title>
|
199
|
+
<format>Poster</format>
|
200
|
+
<product_id>INS89256</product_id>
|
201
|
+
</product>
|
202
|
+
<product>
|
203
|
+
<url>http://www.insound.com/December-8-12-2010-Show-Poster-poster-Arcade-Fire/P/INS90081/&from=86902</url>
|
204
|
+
<artist_name>Arcade Fire</artist_name>
|
205
|
+
<title>December 8-12, 2010 Show Poster</title>
|
206
|
+
<format>Poster</format>
|
207
|
+
<product_id>INS90081</product_id>
|
208
|
+
</product>
|
209
|
+
<product>
|
210
|
+
<url>http://www.insound.com/The-String-Quartet-Tribute-to-Arcade-Fires-Funereal-MP3-Arcade-Fire-String-Quartet-Tribute/P/INS39454/&from=86902</url>
|
211
|
+
<artist_name>Arcade Fire String Quartet Tribute</artist_name>
|
212
|
+
<title>The String Quartet Tribute to Arcade Fire's Funereal</title>
|
213
|
+
<format>MP3</format>
|
214
|
+
<product_id>INS39454</product_id>
|
215
|
+
</product>
|
216
|
+
</product_matches>
|
217
|
+
<artist_matches>
|
218
|
+
<artist>
|
219
|
+
<artist_name>Arcade Fire</artist_name>
|
220
|
+
<url>http://www.insound.com/Arcade-Fire/A/29908/&from=86902</url>
|
221
|
+
<artist_id>29908</artist_id>
|
222
|
+
</artist>
|
223
|
+
<artist>
|
224
|
+
<artist_name>Arcade Fire String Quartet Tribute</artist_name>
|
225
|
+
<url>http://www.insound.com/Arcade-Fire-String-Quartet-Tribute/A/34443/&from=86902</url>
|
226
|
+
<artist_id>34443</artist_id>
|
227
|
+
</artist>
|
228
|
+
<artist>
|
229
|
+
<artist_name>Deep Sea Arcade</artist_name>
|
230
|
+
<url>http://www.insound.com/Deep-Sea-Arcade/A/51254/&from=86902</url>
|
231
|
+
<artist_id>51254</artist_id>
|
232
|
+
</artist>
|
233
|
+
<artist>
|
234
|
+
<artist_name>Flashlight Arcade</artist_name>
|
235
|
+
<url>http://www.insound.com/Flashlight-Arcade/A/30088/&from=86902</url>
|
236
|
+
<artist_id>30088</artist_id>
|
237
|
+
</artist>
|
238
|
+
<artist>
|
239
|
+
<artist_name>LCD Soundsystem / Arcade Fire</artist_name>
|
240
|
+
<url>http://www.insound.com/LCD-Soundsystem-Arcade-Fire/A/34698/&from=86902</url>
|
241
|
+
<artist_id>34698</artist_id>
|
242
|
+
</artist>
|
243
|
+
<artist>
|
244
|
+
<artist_name>LCD Soundsystem/Arcade Fire</artist_name>
|
245
|
+
<url>http://www.insound.com/LCD-SoundsystemArcade-Fire/A/38758/&from=86902</url>
|
246
|
+
<artist_id>38758</artist_id>
|
247
|
+
</artist>
|
248
|
+
<artist>
|
249
|
+
<artist_name>Trance and The Arcade</artist_name>
|
250
|
+
<url>http://www.insound.com/Trance-and-The-Arcade/A/20727/&from=86902</url>
|
251
|
+
<artist_id>20727</artist_id>
|
252
|
+
</artist>
|
253
|
+
</artist_matches>
|
254
|
+
<total_results>37</total_results>
|
255
|
+
<total_product_results>30</total_product_results>
|
256
|
+
<total_artist_results>7</total_artist_results>
|
257
|
+
</insound_query_response>
|
@@ -1,12 +1,11 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
1
2
|
<insound_query_response>
|
2
|
-
<warnings
|
3
|
-
<errors
|
4
|
-
<product_matches/>
|
5
|
-
<artist_matches/>
|
6
|
-
<total_results>0</total_results>
|
7
|
-
<total_product_results>0</total_product_results>
|
8
|
-
<total_artist_results>0</total_artist_results>
|
9
|
-
<search_url>
|
10
|
-
|
11
|
-
</search_url>
|
12
|
-
</insound_query_response>
|
3
|
+
<warnings></warnings>
|
4
|
+
<errors></errors>
|
5
|
+
<product_matches/>
|
6
|
+
<artist_matches/>
|
7
|
+
<total_results>0</total_results>
|
8
|
+
<total_product_results>0</total_product_results>
|
9
|
+
<total_artist_results>0</total_artist_results>
|
10
|
+
<search_url>http://www.insound.com/search/?query=xxcxccxcx&from=86902</search_url>
|
11
|
+
</insound_query_response>
|
data/test/webmock/zen_arcade.xml
CHANGED
@@ -1,36 +1,31 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
1
2
|
<insound_query_response>
|
2
|
-
<warnings
|
3
|
-
<errors
|
4
|
-
<product_matches>
|
5
|
-
<product>
|
6
|
-
<url>
|
7
|
-
|
8
|
-
</
|
9
|
-
<
|
10
|
-
<
|
11
|
-
|
12
|
-
<
|
13
|
-
</
|
14
|
-
<
|
15
|
-
<
|
16
|
-
|
17
|
-
</
|
18
|
-
|
19
|
-
|
20
|
-
<
|
21
|
-
<
|
22
|
-
</
|
23
|
-
</
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
<
|
28
|
-
|
29
|
-
</
|
30
|
-
|
31
|
-
</artist>
|
32
|
-
</artist_matches>
|
33
|
-
<total_results>3</total_results>
|
34
|
-
<total_product_results>2</total_product_results>
|
35
|
-
<total_artist_results>1</total_artist_results>
|
36
|
-
</insound_query_response>
|
3
|
+
<warnings></warnings>
|
4
|
+
<errors></errors>
|
5
|
+
<product_matches>
|
6
|
+
<product>
|
7
|
+
<url>http://www.insound.com/Zen-Arcade-Vinyl-LP-Husker-Du/P/INS13241/&from=86902</url>
|
8
|
+
<artist_name>Husker Du</artist_name>
|
9
|
+
<title>Zen Arcade</title>
|
10
|
+
<format>Vinyl LP</format>
|
11
|
+
<product_id>INS13241</product_id>
|
12
|
+
</product>
|
13
|
+
<product>
|
14
|
+
<url>http://www.insound.com/Zen-Arcade-CD-Husker-Du/P/INS58556/&from=86902</url>
|
15
|
+
<artist_name>Husker Du</artist_name>
|
16
|
+
<title>Zen Arcade</title>
|
17
|
+
<format>CD</format>
|
18
|
+
<product_id>INS58556</product_id>
|
19
|
+
</product>
|
20
|
+
</product_matches>
|
21
|
+
<artist_matches>
|
22
|
+
<artist>
|
23
|
+
<artist_name>Husker Du</artist_name>
|
24
|
+
<url>http://www.insound.com/Husker-Du/A/21544/&from=86902</url>
|
25
|
+
<artist_id>21544</artist_id>
|
26
|
+
</artist>
|
27
|
+
</artist_matches>
|
28
|
+
<total_results>3</total_results>
|
29
|
+
<total_product_results>2</total_product_results>
|
30
|
+
<total_artist_results>1</total_artist_results>
|
31
|
+
</insound_query_response>
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: insound_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Zachary Kloepping
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- lib/insound_api.rb
|
110
110
|
- lib/insound_api/artist.rb
|
111
111
|
- lib/insound_api/config.rb
|
112
|
-
- lib/insound_api/object_base.rb
|
113
112
|
- lib/insound_api/product.rb
|
114
113
|
- lib/insound_api/query.rb
|
115
114
|
- lib/insound_api/request.rb
|
@@ -138,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
137
|
requirements:
|
139
138
|
- - ">="
|
140
139
|
- !ruby/object:Gem::Version
|
141
|
-
hash:
|
140
|
+
hash: 1515459017406889931
|
142
141
|
segments:
|
143
142
|
- 0
|
144
143
|
version: "0"
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module InsoundApi
|
2
|
-
class ObjectBase
|
3
|
-
|
4
|
-
def initialize(node)
|
5
|
-
@node = node
|
6
|
-
end
|
7
|
-
|
8
|
-
def url
|
9
|
-
@url ||= parse_str('url')
|
10
|
-
end
|
11
|
-
|
12
|
-
def title
|
13
|
-
@title ||= parse_str('title')
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def parse_str(selector)
|
19
|
-
Results.parse_str(selector, @node)
|
20
|
-
end
|
21
|
-
|
22
|
-
def parse_int(selector)
|
23
|
-
Results.parse_int(selector, @node)
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|
27
|
-
end
|