spotif-aye 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/lib/spotif-aye.rb +2 -3
- data/lib/spotif-aye/version.rb +1 -1
- data/spec/artist_spec.rb +2 -3
- metadata +9 -13
- data/spec/mock_responses/multiple_results.txt +0 -109
- data/spec/mock_responses/single_result.txt +0 -10
data/lib/spotif-aye.rb
CHANGED
@@ -19,7 +19,7 @@ module SpotifAye
|
|
19
19
|
def self.find(name)
|
20
20
|
response = get("/artist.json?q=#{name}")
|
21
21
|
if response.success?
|
22
|
-
return ResultSet.new(response)
|
22
|
+
return ResultSet.new(response.parsed_response)
|
23
23
|
else
|
24
24
|
raise response.response
|
25
25
|
end
|
@@ -30,8 +30,7 @@ module SpotifAye
|
|
30
30
|
|
31
31
|
attr_accessor :num_results, :limit, :offset, :query, :type, :page, :results
|
32
32
|
|
33
|
-
def initialize(
|
34
|
-
results = JSON.parse(response.parsed_response)
|
33
|
+
def initialize(results)
|
35
34
|
populate_info(results['info'])
|
36
35
|
populate_results(results['artists'])
|
37
36
|
end
|
data/lib/spotif-aye/version.rb
CHANGED
data/spec/artist_spec.rb
CHANGED
@@ -7,8 +7,8 @@ describe SpotifAye::Artist do
|
|
7
7
|
before :each do
|
8
8
|
stub_request(:get, "http://ws.spotify.com/search/1/artist.json?q=stone").to_return(
|
9
9
|
:status => 200,
|
10
|
-
:body => File.new('spec/mock_responses/single_result.
|
11
|
-
:headers => {})
|
10
|
+
:body => File.new('spec/mock_responses/single_result.json'),
|
11
|
+
:headers => {'Content-Type' => 'application/json'})
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'should return a result set' do
|
@@ -49,5 +49,4 @@ describe SpotifAye::Artist do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
-
|
53
52
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotif-aye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-20 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70118382581540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.8.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70118382581540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70118382581040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.7.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70118382581040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: i18n
|
38
|
-
requirement: &
|
38
|
+
requirement: &70118382580580 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70118382580580
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: webmock
|
49
|
-
requirement: &
|
49
|
+
requirement: &70118382580200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70118382580200
|
58
58
|
description: Tries to provide a nicer interface to the metadata api provided by Spotify
|
59
59
|
email:
|
60
60
|
- stuart.liston@gmail.com
|
@@ -70,8 +70,6 @@ files:
|
|
70
70
|
- lib/spotif-aye.rb
|
71
71
|
- lib/spotif-aye/version.rb
|
72
72
|
- spec/artist_spec.rb
|
73
|
-
- spec/mock_responses/multiple_results.txt
|
74
|
-
- spec/mock_responses/single_result.txt
|
75
73
|
- spec/spec_helper.rb
|
76
74
|
- spotif-aye.gemspec
|
77
75
|
homepage: ''
|
@@ -100,6 +98,4 @@ specification_version: 3
|
|
100
98
|
summary: Wrapper for Spotify's Metadata API
|
101
99
|
test_files:
|
102
100
|
- spec/artist_spec.rb
|
103
|
-
- spec/mock_responses/multiple_results.txt
|
104
|
-
- spec/mock_responses/single_result.txt
|
105
101
|
- spec/spec_helper.rb
|
@@ -1,109 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"info":
|
3
|
-
{
|
4
|
-
"num_results": 827, "limit": 100, "offset": 0, "query": "stone", "type": "artist", "page": 1
|
5
|
-
},
|
6
|
-
"artists":
|
7
|
-
[
|
8
|
-
{"href": "spotify:artist:7bvcQXJHkFiN1ppIN3q4fi", "name": "Joss Stone", "popularity": "0.58240"},
|
9
|
-
{"href": "spotify:artist:1lYT0A0LV5DUfxr6doRP3d", "name": "The Stone Roses", "popularity": "0.52377"},
|
10
|
-
{"href": "spotify:artist:4tvKz56Tr39bkhcQUTO0Xr", "name": "Angus & Julia Stone", "popularity": "0.52222"},
|
11
|
-
{"href": "spotify:artist:5m8H6zSadhu1j9Yi04VLqD", "name": "Sly & The Family Stone", "popularity": "0.52089"},
|
12
|
-
{"href": "spotify:artist:4pejUc4iciQfgdX6OKulQn", "name": "Queens Of The Stone Age", "popularity": "0.52471"},
|
13
|
-
{"href": "spotify:artist:2hWr3AjjKOCVmWcwvuT4uM", "name": "Angie Stone", "popularity": "0.48773"},
|
14
|
-
{"href": "spotify:artist:49qiE8dj4JuNdpYGRPdKbF", "name": "Stone Sour", "popularity": "0.37666"},
|
15
|
-
{"href": "spotify:artist:2UazAtjfzqBF0Nho2awK4z", "name": "Stone Temple Pilots", "popularity": "0.38195"},
|
16
|
-
{"href": "spotify:artist:4KJjihrZR0XfiOPB0MdMVz", "name": "Stone", "popularity": "0.29804"},
|
17
|
-
{"href": "spotify:artist:4gZRt9wlRx1IsxT9glJdrc", "name": "Julia Stone", "popularity": "0.28443"},
|
18
|
-
{"href": "spotify:artist:6WMo39FU3nrpSz3qMgRKug", "name": "Black Stone Cherry", "popularity": "0.26933"},
|
19
|
-
{"href": "spotify:artist:6hA6GJ2yJA08ifsAplkUr0", "name": "Sly Stone", "popularity": "0.24741"},
|
20
|
-
{"href": "spotify:artist:0n21JCIbeLnQGAittsding", "name": "Angus and Julia Stone", "popularity": "0.24945"},
|
21
|
-
{"href": "spotify:artist:536osqBGKzeozje8BfcGsa", "name": "Allen Stone", "popularity": "0.22147"},
|
22
|
-
{"href": "spotify:artist:4epBFW4UHEmgjIK5xOrBhk", "name": "Doug Stone", "popularity": "0.21994"},
|
23
|
-
{"href": "spotify:artist:2ZJJwhtLcXYiJGIFbdcz5i", "name": "CJ Stone", "popularity": "0.21322"},
|
24
|
-
{"href": "spotify:artist:40N10exWtaCVUtBMftQn3t", "name": "The Stone Foxes", "popularity": "0.16158"},
|
25
|
-
{"href": "spotify:artist:5kUCjPuHfsYBoSTLzB1Kx9", "name": "Solar Stone", "popularity": "0.12354"},
|
26
|
-
{"href": "spotify:artist:5AqacAhvN8JCsr00Qk9tb7", "name": "Dan Stone", "popularity": "0.11834"},
|
27
|
-
{"href": "spotify:artist:0UnBsBrom4chs5rnjRBtIK", "name": "Rosetta Stone", "popularity": "0.11168"},
|
28
|
-
{"href": "spotify:artist:6yKs08l3FDns2Dbisiwjp2", "name": "Sly and The Family Stone", "popularity": "0.13100"},
|
29
|
-
{"href": "spotify:artist:68V1TH2chbUSLvqGkfBW6S", "name": "Ricky Martin Feat. Joss Stone", "popularity": "0.11363"},
|
30
|
-
{"href": "spotify:artist:17g9izQ35blndiUPLhGodI", "name": "Dwight Stone", "popularity": "0.08232"},
|
31
|
-
{"href": "spotify:artist:5yX0L9mpGpFNGnjmigyNCI", "name": "Alexandra Stone", "popularity": "0.06778"},
|
32
|
-
{"href": "spotify:artist:4TBZbclpBnXENejnt0ZIpr", "name": "Angus Stone", "popularity": "0.06334"},
|
33
|
-
{"href": "spotify:artist:40Ar1CY9WEPWK7b211IK81", "name": "Lew Stone", "popularity": "0.05864"},
|
34
|
-
{"href": "spotify:artist:6jk128BjcZxmf8G90D7oOk", "name": "Stone Senses", "popularity": "0.05658"},
|
35
|
-
{"href": "spotify:artist:3yjToJqlGuhwzaCkUpUfq9", "name": "Stu Stone", "popularity": "0.05541"},
|
36
|
-
{"href": "spotify:artist:0kNyq4Q2UEmIeuySw9myZc", "name": "Corner Stone Cues", "popularity": "0.06280"},
|
37
|
-
{"href": "spotify:artist:49gYweXA3mqGBbkkpeyWGq", "name": "Raphael Saadiq featuring Joss Stone", "popularity": "0.05961"},
|
38
|
-
{"href": "spotify:artist:7s38JtwIABfvYYGTKOa5EV", "name": "Kay Stone", "popularity": "0.04489"},
|
39
|
-
{"href": "spotify:artist:7i6OjbTBFvpVYkJv4zkNcB", "name": "Stone Roses", "popularity": "0.04489"},
|
40
|
-
{"href": "spotify:artist:2IvPBSC4CgNLYC1GHEAxcN", "name": "Stevie Stone", "popularity": "0.04296"},
|
41
|
-
{"href": "spotify:artist:1TqikbzYvrf59XGJQgCNzQ", "name": "Steven Stone", "popularity": "0.04051"},
|
42
|
-
{"href": "spotify:artist:2lK3YnHTaukG6VJ09GmeYo", "name": "Sly & The Family Stone|Slave|James Brown|Dazz Band|Teddy Pendergrass|Marvin Gaye", "popularity": "0.07424"},
|
43
|
-
{"href": "spotify:artist:4sOQLWxzmPMffkbPWbZCHh", "name": "Stone Axe", "popularity": "0.03748"},
|
44
|
-
{"href": "spotify:artist:5ZCcVPmY6ymLPStzhEFolI", "name": "Blue Stone", "popularity": "0.03657"},
|
45
|
-
{"href": "spotify:artist:4Dx4u9AniPCl5nwkIjleyr", "name": "Eddie Vedder and Stone Gossard", "popularity": "0.04544"},
|
46
|
-
{"href": "spotify:artist:4xSTICF3RLqUa98dFRWtpO", "name": "Lew Stone & His Band", "popularity": "0.03811"},
|
47
|
-
{"href": "spotify:artist:0VTxjW8pGDbhEZUAZkQ59L", "name": "Stone & The DJ", "popularity": "0.03384"},
|
48
|
-
{"href": "spotify:artist:2YbzY5WCnWFA2JlU16lqsV", "name": "Stone Gods", "popularity": "0.02797"},
|
49
|
-
{"href": "spotify:artist:2vThUcryaKNLhULHOzP3eH", "name": "Ranking Stone", "popularity": "0.02716"},
|
50
|
-
{"href": "spotify:artist:1AdFLjG5endQ2HmDMtp5Fe", "name": "Stone The Crows", "popularity": "0.02954"},
|
51
|
-
{"href": "spotify:artist:2X9nnux4eS3CFBDSjcnoBQ", "name": "Stone Poneys", "popularity": "0.02190"},
|
52
|
-
{"href": "spotify:artist:0BUHAyLpATEPKRkwJWXdLp", "name": "Connemara Stone Company", "popularity": "0.02436"},
|
53
|
-
{"href": "spotify:artist:5hZywvBMNgzCBy7KPdgreK", "name": "Jamie Kennedy & Stu Stone", "popularity": "0.02429"},
|
54
|
-
{"href": "spotify:artist:4LyTW4sS5IQyL747sxyOnf", "name": "Angie Stone feat. Calvin", "popularity": "0.02424"},
|
55
|
-
{"href": "spotify:artist:1JqOqsJ3cetrCm1oM2eQik", "name": "Josh Stone", "popularity": "0.01966"},
|
56
|
-
{"href": "spotify:artist:3I9Cw0rM60M8B0McapBeoR", "name": "Joe D'Urso & Stone Caravan", "popularity": "0.02225"},
|
57
|
-
{"href": "spotify:artist:2mFEB1yADKv56pUDpTqSqb", "name": "The First Stone", "popularity": "0.02165"},
|
58
|
-
{"href": "spotify:artist:5NQy6baJWodZVDa5455PYk", "name": "Lew Stone And His Band", "popularity": "0.02358"},
|
59
|
-
{"href": "spotify:artist:4aT4S9Vq35xkN87Yiunjt3", "name": "Mark Stone", "popularity": "0.01727"},
|
60
|
-
{"href": "spotify:artist:5PENIK8WHcB1eGR421rkAJ", "name": "Chris Stone", "popularity": "0.01667"},
|
61
|
-
{"href": "spotify:artist:4GiJ9YyQUx7kJXT3IJb6oU", "name": "Twigg & Stone", "popularity": "0.01616"},
|
62
|
-
{"href": "spotify:artist:0XGZ1FLCVSbsBHpBCJabYO", "name": "Angie Stone featuring Anthony Hamilton", "popularity": "0.02160"},
|
63
|
-
{"href": "spotify:artist:06sqgSBkdTBvcV3yVklLEL", "name": "Stone Free: A Tribute to Jimi Hendrix", "popularity": "0.02441"},
|
64
|
-
{"href": "spotify:artist:0u0YN6DvyVjiUSzVMIX28S", "name": "Stone Gossard, Mike McCready, Jeff Ament and Chris Friel", "popularity": "0.02595"},
|
65
|
-
{"href": "spotify:artist:5E5WJyfvRW19sZFG32gzSQ", "name": "Kid Stone", "popularity": "0.01308"},
|
66
|
-
{"href": "spotify:artist:5vu3oBxfWGEauRbyFp9E4Y", "name": "Angie Stone feat. Alicia Keys & Eve", "popularity": "0.01980"},
|
67
|
-
{"href": "spotify:artist:7tQx0SAWKmjZtpAqoeBEbk", "name": "Angus & Julia Stone Band", "popularity": "0.01464"},
|
68
|
-
{"href": "spotify:artist:09w2nmrWDRCL0wtRqoNLdM", "name": "Eric Stone", "popularity": "0.01110"},
|
69
|
-
{"href": "spotify:artist:6LaeuXyOjdRMxpZqFUJXSF", "name": "Cliffie Stone", "popularity": "0.01054"},
|
70
|
-
{"href": "spotify:artist:7utN8P698fXhCDd4mSrsns", "name": "Macy Gray featuring Angie Stone and Mos Def", "popularity": "0.01969"},
|
71
|
-
{"href": "spotify:artist:4MV8idwPVmHcxZjT0fjsDx", "name": "Angie Stone & Joe", "popularity": "0.01272"},
|
72
|
-
{"href": "spotify:artist:5EVOoLv2B5cIzu4eEiyFuQ", "name": "Floating Stone", "popularity": "0.00894"},
|
73
|
-
{"href": "spotify:artist:47bokO26f4LIt4zaAlCQwo", "name": "Elephant Stone", "popularity": "0.00881"},
|
74
|
-
{"href": "spotify:artist:2TDSXxzZIS1oDg3L9fk4aK", "name": "Jamie Kennedy & Stu Stone", "popularity": "0.01083"},
|
75
|
-
{"href": "spotify:artist:2TRaJKJyCPZO8fyz698CJZ", "name": "The Stone Poneys", "popularity": "0.01077"},
|
76
|
-
{"href": "spotify:artist:7FrEdhlyISrRxcmR5EQhIO", "name": "Stone Canyon", "popularity": "0.00867"},
|
77
|
-
{"href": "spotify:artist:73oVHjkFKwe9kRheYvbLL9", "name": "Stone Age", "popularity": "0.00860"},
|
78
|
-
{"href": "spotify:artist:0bzZT5BwQ7RXTpQHKOAeG0", "name": "Apple & Stone", "popularity": "0.00787"},
|
79
|
-
{"href": "spotify:artist:6ihpa5zgHEYPbYr27mSAuj", "name": "Sly Stone & The Mojo Men", "popularity": "0.01098"},
|
80
|
-
{"href": "spotify:artist:1p0NholKJLtbG8rnYRPsMG", "name": "The Stone Coyotes", "popularity": "0.00951"},
|
81
|
-
{"href": "spotify:artist:2ms3xThJ4kusbTSioFohyS", "name": "Stone & Charden", "popularity": "0.00768"},
|
82
|
-
{"href": "spotify:artist:4ndPdP6aVSDCvhsjOHLGjb", "name": "Stone et Charden", "popularity": "0.00927"},
|
83
|
-
{"href": "spotify:artist:3cr8Cd4OFcYEc63zZu1Szg", "name": "Santana featuring Sean Paul & Joss Stone", "popularity": "0.01203"},
|
84
|
-
{"href": "spotify:artist:0PMtZ48ugLkoxg4cjggEVl", "name": "Stone Black", "popularity": "0.00738"},
|
85
|
-
{"href": "spotify:artist:6Rp18SVmMFIZRHRoD0wj9X", "name": "Angie Stone feat. Musiq Soulchild", "popularity": "0.00996"},
|
86
|
-
{"href": "spotify:artist:2YIFiyLIUhMH9kzb0FCmbX", "name": "Brandon Stone", "popularity": "0.00651"},
|
87
|
-
{"href": "spotify:artist:0bO3bOZwJNmh750eBf0aA0", "name": "Jesse Stone", "popularity": "0.00629"},
|
88
|
-
{"href": "spotify:artist:5tUSgp6KX97m37HMbBgTwU", "name": "Steve Stone", "popularity": "0.00616"},
|
89
|
-
{"href": "spotify:artist:09xL6Rso5T14vYo6ji8Gmq", "name": "Q-Stone", "popularity": "0.00601"},
|
90
|
-
{"href": "spotify:artist:3TJTZNpLyscwiDwlZsTX4Y", "name": "Preacher Stone", "popularity": "0.00592"},
|
91
|
-
{"href": "spotify:artist:2OOTZ9s1DnVNQnvkRgpKpD", "name": "Andy Stone & Kat Zero", "popularity": "0.00729"},
|
92
|
-
{"href": "spotify:artist:0UkhQeHmaegeLcaDXBjpkl", "name": "Ty Stone", "popularity": "0.00576"},
|
93
|
-
{"href": "spotify:artist:4rxyoc13lO8BoilliyUf47", "name": "Tyte Stone", "popularity": "0.00570"},
|
94
|
-
{"href": "spotify:artist:1DjvnBVnM1YGCC6jrEKcTR", "name": "Thom Stone", "popularity": "0.00567"},
|
95
|
-
{"href": "spotify:artist:6jEAwZdvV4fYoplzok8yO6", "name": "CJ Stone & Chriss Ortega", "popularity": "0.00702"},
|
96
|
-
{"href": "spotify:artist:1TGwUWwVcKAYoXSuXVZUxt", "name": "Stone Mecca", "popularity": "0.00560"},
|
97
|
-
{"href": "spotify:artist:4F2HKVxNOxDZJzsditSbBf", "name": "Stone River Boys", "popularity": "0.00605"},
|
98
|
-
{"href": "spotify:artist:2H1K3K1jTG7GI1nmu1zL0J", "name": "Bread of Stone", "popularity": "0.00603"},
|
99
|
-
{"href": "spotify:artist:3ub47QhezGBj3fsCXn6jma", "name": "Jonathan Stone", "popularity": "0.00462"},
|
100
|
-
{"href": "spotify:artist:4SDFoX1GFLyoP1r9w26mfr", "name": "Stone Antica", "popularity": "0.00460"},
|
101
|
-
{"href": "spotify:artist:0rVkv5DwsmIbQg2ECWMQGT", "name": "Stone Foundation", "popularity": "0.00446"},
|
102
|
-
{"href": "spotify:artist:3PM5EQ1NOCRtuhb6CS8qsY", "name": "Rick Nelson And The Stone Canyon Band", "popularity": "0.00729"},
|
103
|
-
{"href": "spotify:artist:4ZzNfsfOJrl9jsklNxJ9rO", "name": "Alexia Stone", "popularity": "0.00445"},
|
104
|
-
{"href": "spotify:artist:1DwDghZjRzH4LJjLrQ5Kz3", "name": "Kim Stone", "popularity": "0.00417"},
|
105
|
-
{"href": "spotify:artist:5mH7gMQLYmFW0wsYncxxMR", "name": "Earth & Stone", "popularity": "0.00401"},
|
106
|
-
{"href": "spotify:artist:5RvX7694GlgGLE7amVLGma", "name": "The Philosopher's Stone", "popularity": "0.00496"},
|
107
|
-
{"href": "spotify:artist:4LBtSkOX4csRDfqStKgz75", "name": "Stone Cold Steve Austin", "popularity": "0.00438"}
|
108
|
-
]
|
109
|
-
}
|