sandro-metamuse 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/.document +5 -0
  2. data/.gitignore +6 -0
  3. data/MIT_LICENSE +20 -0
  4. data/README.rdoc +7 -0
  5. data/Rakefile +48 -0
  6. data/VERSION +1 -0
  7. data/lib/array_ext.rb +5 -0
  8. data/lib/arrayish.rb +23 -0
  9. data/lib/httparty_ext.rb +16 -0
  10. data/lib/metamuse.rb +71 -0
  11. data/lib/metamuse/album.rb +19 -0
  12. data/lib/metamuse/artist.rb +43 -0
  13. data/lib/metamuse/association.rb +48 -0
  14. data/lib/metamuse/collection.rb +25 -0
  15. data/lib/metamuse/services.rb +16 -0
  16. data/lib/metamuse/services/echonest.rb +26 -0
  17. data/lib/metamuse/services/freebase.rb +43 -0
  18. data/lib/metamuse/services/lastfm.rb +27 -0
  19. data/lib/metamuse/services/lastfm/image.rb +41 -0
  20. data/lib/metamuse/services/music_brainz.rb +27 -0
  21. data/lib/metamuse/track.rb +13 -0
  22. data/lib/object_ext.rb +11 -0
  23. data/metamuse.gemspec +89 -0
  24. data/script/console +8 -0
  25. data/spec/fake_object.rb +38 -0
  26. data/spec/fake_object_spec.rb +66 -0
  27. data/spec/metamuse/album_spec.rb +4 -0
  28. data/spec/metamuse/artist_spec.rb +99 -0
  29. data/spec/metamuse/association_spec.rb +74 -0
  30. data/spec/metamuse/collection_spec.rb +4 -0
  31. data/spec/metamuse/services/echonest_spec.rb +28 -0
  32. data/spec/metamuse/services/freebase_spec.rb +24 -0
  33. data/spec/metamuse/services/lastfm/image_spec.rb +71 -0
  34. data/spec/metamuse/services/lastfm_spec.rb +30 -0
  35. data/spec/metamuse/services/music_brainz_spec.rb +12 -0
  36. data/spec/metamuse_spec.rb +21 -0
  37. data/spec/spec_helper.rb +27 -0
  38. data/spec/web_fixtures/GET_developer.echonest.com-api-search_artists_17a9da1.fixture +36 -0
  39. data/spec/web_fixtures/GET_developer.echonest.com-api-search_artists_350c352.fixture +36 -0
  40. data/spec/web_fixtures/GET_musicbrainz.org-ws-1-release-bb32aa1d-f37b-4134-8c0e-b43b7a6dab85_b976ba7.fixture +26 -0
  41. data/spec/web_fixtures/GET_www.freebase.com-api-service-mqlread_60ee2bd.fixture +938 -0
  42. data/spec/web_fixtures/GET_www.freebase.com-api-service-mqlread_b8b2565.fixture +107 -0
  43. metadata +106 -0
@@ -0,0 +1,4 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe Metamuse::Collection do
4
+ end
@@ -0,0 +1,28 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe Metamuse::Services::Echonest do
4
+ describe "finding an artist" do
5
+ before do
6
+ @query = "coldplay"
7
+ @response = {'response' => {'artists' => {}}}
8
+ end
9
+
10
+ it "returns nil when no artist was found" do
11
+ @response['response'] = {'artists' => nil}
12
+ stub(Metamuse::Services::Echonest).get { @response}
13
+ Metamuse::Services::Echonest.artist(@query).should be_nil
14
+ end
15
+
16
+ it "returns the first of a collection of artists" do
17
+ @response['response']['artists'].merge! "artist"=>[{"name"=>"Battles", "id"=>"1"}, {"name"=>"The Battles", "id"=>"2"}]
18
+ stub(Metamuse::Services::Echonest).get { @response}
19
+ Metamuse::Services::Echonest.artist(@query).should be_instance_of(Metamuse::Artist)
20
+ end
21
+
22
+ it "returns the one matching artist" do
23
+ @response['response']['artists'].merge! "artist"=>{"name"=>"Coldplay", "id"=>"1"}
24
+ stub(Metamuse::Services::Echonest).get { @response}
25
+ Metamuse::Services::Echonest.artist(@query).should be_instance_of(Metamuse::Artist)
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,24 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe Metamuse::Services::Freebase do
4
+ context "build_artist" do
5
+ before do
6
+ @response = {'result' => {'name' => 'artist', 'guid' => '1'}}
7
+ @album = {'name' => 'album', 'release_date' => 'today', 'freebase_id' => '1', 'track' => []}
8
+ end
9
+
10
+ it "parses one album" do
11
+ @response['result'].merge! 'album' => @album
12
+ artist = Metamuse::Services::Freebase.send(:build_artist, @response)
13
+ artist.albums.size.should == 1
14
+ artist.albums.first.name.should == 'album'
15
+ end
16
+
17
+ it "parses multiple album" do
18
+ @response['result'].merge! 'album' => [@album, @album.merge('name' => 'album2')]
19
+ artist = Metamuse::Services::Freebase.send(:build_artist, @response)
20
+ artist.albums.size.should == 2
21
+ artist.albums.last.name.should == 'album2'
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,71 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
2
+
3
+ describe Metamuse::Services::Lastfm::Image do
4
+ before do
5
+ @small_location = "http://userserve-ak.last.fm/serve/34s/14349365.jpg"
6
+ @medium_location = "http://userserve-ak.last.fm/serve/64s/14349365.jpg"
7
+ @large_location = "http://userserve-ak.last.fm/serve/126/14349365.jpg"
8
+ @extra_large_location = "http://userserve-ak.last.fm/serve/300x300/14349365.jpg"
9
+ end
10
+
11
+ subject { Metamuse::Services::Lastfm::Image.new @small_location }
12
+
13
+ it "has a small size" do
14
+ subject.size.should == :small
15
+ end
16
+
17
+ it "has small dimensions" do
18
+ subject.dimensions.should == Metamuse::Services::Lastfm::Image::DIMENSIONS[:small]
19
+ end
20
+
21
+ describe "#size" do
22
+ context "supported sizes" do
23
+ it "returns small size" do
24
+ image = Metamuse::Services::Lastfm::Image.new @small_location
25
+ image.size.should == :small
26
+ end
27
+
28
+ it "returns medium size" do
29
+ image = Metamuse::Services::Lastfm::Image.new @medium_location
30
+ image.size.should == :medium
31
+ end
32
+
33
+ it "returns large size" do
34
+ image = Metamuse::Services::Lastfm::Image.new @large_location
35
+ image.size.should == :large
36
+ end
37
+
38
+ it "returns extra large size" do
39
+ image = Metamuse::Services::Lastfm::Image.new @extra_large_location
40
+ image.size.should == :extra_large
41
+ end
42
+ end
43
+
44
+ context "unsupported size" do
45
+ it "returns nil size" do
46
+ image = Metamuse::Services::Lastfm::Image.new '/images/1.jpg'
47
+ image.size.should be_nil
48
+ end
49
+ end
50
+ end
51
+
52
+ describe "#dimensions" do
53
+ it "finds the dimensions of a small image" do
54
+ subject.dimensions.should == "34x34"
55
+ end
56
+ end
57
+
58
+ describe "width and height" do
59
+ before do
60
+ mock(subject).dimensions {"800x600"}
61
+ end
62
+
63
+ it "finds width by the first dimension" do
64
+ subject.width.should == "800"
65
+ end
66
+
67
+ it "finds height by the last dimension" do
68
+ subject.height.should == "600"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,30 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe Metamuse::Services::Lastfm do
4
+ subject { Metamuse::Services::Lastfm }
5
+ describe "#build_albums" do
6
+ before do
7
+ albums = [ {'name' => 'Album', 'mbid' => '123', 'rank' => '1', 'image' => []} ]
8
+ @response = {'lfm' => {'topalbums' => {'album' => albums} }}
9
+ end
10
+
11
+ it "creates an album with a name, mbid, rank, and images" do
12
+ mock(Metamuse::Album).new({:name => 'Album', :mbid => '123', :rank => '1', :images => []})
13
+ subject.send(:build_albums, @response)
14
+ end
15
+
16
+ context "response with images" do
17
+ before do
18
+ images = %w(1.jpg 2.jpg)
19
+ albums = [ {'image' => images} ]
20
+ @response = {'lfm' => {'topalbums' => {'album' => albums} }}
21
+ end
22
+
23
+ it "builds a Lastfm::Image for each image location" do
24
+ mock(Metamuse::Services::Lastfm::Image).new('1.jpg')
25
+ mock(Metamuse::Services::Lastfm::Image).new('2.jpg')
26
+ subject.send(:build_albums, @response)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe Metamuse::Services::MusicBrainz do
4
+ describe ".album" do
5
+ subject { Metamuse::Services::MusicBrainz }
6
+
7
+ it "Finds an album with tracks" do
8
+ album = subject.album("bb32aa1d-f37b-4134-8c0e-b43b7a6dab85")
9
+ album.tracks.should_not be_empty
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Metamuse" do
4
+ describe "integration" do
5
+ it "finds coldplay" do
6
+ Metamuse.echonest_api_key = "TEST"
7
+ Metamuse.find_artist('coldplay').name.should == 'Coldplay'
8
+ end
9
+ end
10
+
11
+ describe "finding an artist" do
12
+ it "searches through echonest" do
13
+ mock(Metamuse::Services::Echonest).artist('coldplay')
14
+ Metamuse.find_artist('coldplay')
15
+ end
16
+ end
17
+
18
+ describe "finding tracks" do
19
+
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'metamuse'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+ require 'rr'
7
+ require 'fake_object'
8
+ $LOAD_PATH.unshift("/Users/santuri/Code/Ruby/fakeweb/lib")
9
+ require 'fake_web'
10
+ include FakeObject
11
+
12
+ Spec::Runner.configure do |config|
13
+ config.mock_with RR::Adapters::Rspec
14
+ end
15
+
16
+ def web_fixture(filename)
17
+ File.join(File.dirname(__FILE__), %W[web_fixtures #{filename}])
18
+ end
19
+
20
+ fixture_dir = File.join(File.dirname(__FILE__), %w(web_fixtures))
21
+
22
+ FakeWeb.generate_fixtures fixture_dir if ENV['FAKEWEB_FIXTURES']
23
+
24
+ unless FakeWeb.generate_fixtures?
25
+ FakeWeb.register_fixtures fixture_dir
26
+ FakeWeb.allow_net_connect = false
27
+ end
@@ -0,0 +1,36 @@
1
+ --- !ruby/object:FakeWeb::Fixture
2
+ file_name: GET_developer.echonest.com-api-search_artists_17a9da1.fixture
3
+ method: :get
4
+ path: /Users/santuri/Code/Ruby/metamuse/spec/web_fixtures
5
+ response: !ruby/object:Net::HTTPOK
6
+ body: |-
7
+ <?xml version="1.0" encoding="UTF-8"?>
8
+ <response version="3"><status><code>1</code><message>Invalid API key</message></status><query><parameter name="api_key">TEST</parameter><parameter name="query">coldplay</parameter><parameter name="exact">N</parameter><parameter name="sounds_like">Y</parameter><parameter name="rows">15</parameter></query></response>
9
+ body_exist: true
10
+ code: "200"
11
+ header:
12
+ vary:
13
+ - Accept-Encoding
14
+ cache-control:
15
+ - max-age=0
16
+ last-modified:
17
+ - Sun, 12 Jul 2009 08:51:18 GMT
18
+ connection:
19
+ - close
20
+ expires:
21
+ - Sun, 12 Jul 2009 08:51:18 GMT
22
+ content-type:
23
+ - text/xml; charset=utf-8
24
+ etag:
25
+ - "\"009fc576f34f8bcdef29d743a855a3ab\""
26
+ date:
27
+ - Sun, 12 Jul 2009 08:51:18 GMT
28
+ server:
29
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_wsgi/2.3
30
+ transfer-encoding:
31
+ - chunked
32
+ http_version: "1.1"
33
+ message: OK
34
+ read: true
35
+ socket:
36
+ uri: http://developer.echonest.com:80/api/search_artists?query=coldplay&version=3&api_key=TEST
@@ -0,0 +1,36 @@
1
+ --- !ruby/object:FakeWeb::Fixture
2
+ file_name: GET_developer.echonest.com-api-search_artists_350c352.fixture
3
+ method: :get
4
+ path: /Users/santuri/Code/Ruby/metamuse/spec/web_fixtures
5
+ response: !ruby/object:Net::HTTPOK
6
+ body: |-
7
+ <?xml version="1.0" encoding="UTF-8"?>
8
+ <response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">TEST</parameter><parameter name="query">coldplay</parameter><parameter name="exact">N</parameter><parameter name="sounds_like">Y</parameter><parameter name="rows">15</parameter></query><artists><artist><id>music://id.echonest.com/~/AR/ARJ7KF01187B98D717</id><name>Coldplay</name></artist><artist><id>music://id.echonest.com/~/AR/ARWIGKG121318C57F8</id><name>Karaoke - Coldplay</name></artist><artist><id>music://id.echonest.com/~/AR/ARKVUOD121318C5980</id><name>Various Artists - Coldplay Tribute</name></artist></artists></response>
9
+ body_exist: true
10
+ code: "200"
11
+ header:
12
+ vary:
13
+ - Accept-Encoding
14
+ cache-control:
15
+ - max-age=0
16
+ last-modified:
17
+ - Tue, 30 Jun 2009 00:34:55 GMT
18
+ connection:
19
+ - close
20
+ expires:
21
+ - Tue, 30 Jun 2009 00:34:55 GMT
22
+ content-type:
23
+ - text/xml; charset=utf-8
24
+ etag:
25
+ - "\"0d66ceeff95dc6fb9b64167ab260571d\""
26
+ date:
27
+ - Tue, 30 Jun 2009 00:34:53 GMT
28
+ server:
29
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_wsgi/2.3
30
+ transfer-encoding:
31
+ - chunked
32
+ http_version: "1.1"
33
+ message: OK
34
+ read: true
35
+ socket:
36
+ uri: http://developer.echonest.com:80/api/search_artists?version=3&api_key=TEST&query=coldplay
@@ -0,0 +1,26 @@
1
+ --- !ruby/object:FakeWeb::Fixture
2
+ file_name: GET_musicbrainz.org-ws-1-release-bb32aa1d-f37b-4134-8c0e-b43b7a6dab85_b976ba7.fixture
3
+ method: :get
4
+ path: /Users/santuri/Code/Ruby/metamuse/spec/web_fixtures
5
+ response: !ruby/object:Net::HTTPOK
6
+ body: <?xml version="1.0" encoding="UTF-8"?><metadata xmlns="http://musicbrainz.org/ns/mmd-1.0#" xmlns:ext="http://musicbrainz.org/ns/ext-1.0#"><release id="bb32aa1d-f37b-4134-8c0e-b43b7a6dab85" type="Album Official" ><title>X&amp;Y</title><text-representation language="ENG" script="Latn"/><asin>B000AU1NY2</asin><track-list><track id="3424956a-8f57-4da7-b249-bc639e226093"><title>Square One</title><duration>287000</duration></track><track id="9bb6271e-4be2-4fa4-b473-398b3db19505"><title>What If</title><duration>297000</duration></track><track id="9faa00d6-402f-4940-bf45-9506d555040f"><title>White Shadows</title><duration>328000</duration></track><track id="b4ded6ef-43e4-4624-9227-030e8821d481"><title>Fix You</title><duration>294000</duration></track><track id="d58f99c7-d392-4e08-a7df-158c1c270704"><title>Talk</title><duration>311000</duration></track><track id="87bcc70a-c112-491a-a756-949cc0c868af"><title>X&amp;Y</title><duration>274000</duration></track><track id="37fdd9e0-1491-45c2-9fdc-b96c558628fc"><title>Speed of Sound</title><duration>288000</duration></track><track id="255d3d30-35be-4d04-a2b8-94d44f250a10"><title>A Message</title><duration>285000</duration></track><track id="39e76f5c-f872-4306-86c0-becffbe5cbf9"><title>Low</title><duration>332000</duration></track><track id="10990f80-741b-434b-891a-e47752e6a6b3"><title>The Hardest Part</title><duration>265000</duration></track><track id="7c3f859d-ac4e-4663-849d-e5fd9769c846"><title>Swallowed in the Sea</title><duration>238000</duration></track><track id="1eb87a18-3e22-46dc-8b54-401c667908fd"><title>Twisted Logic</title><duration>301000</duration></track><track id="4bacf4f1-bad6-4e39-81d8-7397ca851043"><title>Til Kingdom Come / Pour Me (live)</title><duration>582000</duration></track></track-list></release></metadata>
7
+ body_exist: true
8
+ code: "200"
9
+ header:
10
+ connection:
11
+ - close
12
+ via:
13
+ - 1.1 musicbrainz.org
14
+ content-type:
15
+ - text/xml; charset=utf-8
16
+ date:
17
+ - Sun, 12 Jul 2009 08:51:17 GMT
18
+ server:
19
+ - Apache/1.3.41 (Unix) mod_perl/1.30
20
+ content-length:
21
+ - "1797"
22
+ http_version: "1.1"
23
+ message: OK
24
+ read: true
25
+ socket:
26
+ uri: http://musicbrainz.org:80/ws/1/release/bb32aa1d-f37b-4134-8c0e-b43b7a6dab85/?type=xml&inc=tracks
@@ -0,0 +1,938 @@
1
+ --- !ruby/object:FakeWeb::Fixture
2
+ file_name: GET_www.freebase.com-api-service-mqlread_60ee2bd.fixture
3
+ method: :get
4
+ path: ./spec/metamuse/services/../../web_fixtures
5
+ response: !ruby/object:Net::HTTPOK
6
+ body: |-
7
+ {
8
+ "code": "/api/status/ok",
9
+ "result": {
10
+ "album": [
11
+ {
12
+ "/common/topic/image": [],
13
+ "id": "/en/clocks_remixes",
14
+ "name": "Clocks Remixes",
15
+ "release_date": null,
16
+ "release_type": "EP",
17
+ "track": [
18
+ {
19
+ "index": 0,
20
+ "name": "Clocks (R\u00f6yksopp Trembling Heart remix)"
21
+ },
22
+ {
23
+ "index": 1,
24
+ "name": "Clocks (R\u00f6yksopp Instrumental Trembling Heart remix)"
25
+ },
26
+ {
27
+ "index": 2,
28
+ "name": "God Put a Smile Upon Your Face (Def Inc. remix)"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "/common/topic/image": [],
34
+ "id": "/en/clocks_11_05_2002_ahoy_rotterdam",
35
+ "name": "Clocks: 11-05-2002: Ahoy, Rotterdam",
36
+ "release_date": null,
37
+ "release_type": "EP",
38
+ "track": [
39
+ {
40
+ "index": 0,
41
+ "name": "Clocks (live)"
42
+ },
43
+ {
44
+ "index": 1,
45
+ "name": "In My Place"
46
+ },
47
+ {
48
+ "index": 2,
49
+ "name": "Everything's Not Lost (live)"
50
+ },
51
+ {
52
+ "index": 3,
53
+ "name": "Yellow (live)"
54
+ },
55
+ {
56
+ "index": 4,
57
+ "name": "Clocks"
58
+ },
59
+ {
60
+ "index": 5,
61
+ "name": "Trouble (live)"
62
+ },
63
+ {
64
+ "index": 6,
65
+ "name": "The Scientist (live)"
66
+ },
67
+ {
68
+ "index": 7,
69
+ "name": "Green Eyes / Mooie Ellebogen (live)"
70
+ },
71
+ {
72
+ "index": 8,
73
+ "name": "Clocks (edit)"
74
+ },
75
+ {
76
+ "index": 9,
77
+ "name": "Politik (live)"
78
+ },
79
+ {
80
+ "index": 10,
81
+ "name": "Shiver (live)"
82
+ },
83
+ {
84
+ "index": 11,
85
+ "name": "Daylight (live)"
86
+ }
87
+ ]
88
+ },
89
+ {
90
+ "/common/topic/image": [],
91
+ "id": "/guid/9202a8c04000641f800000000304023c",
92
+ "name": "Don't Panic",
93
+ "release_date": null,
94
+ "release_type": "Single",
95
+ "track": [
96
+ {
97
+ "index": 0,
98
+ "name": "Don't Panic"
99
+ },
100
+ {
101
+ "index": 1,
102
+ "name": "Spies (live, 2000: Lowlands)"
103
+ },
104
+ {
105
+ "index": 2,
106
+ "name": "Bigger Stronger (live, 2000: Lowlands)"
107
+ },
108
+ {
109
+ "index": 3,
110
+ "name": "Yellow (live, 2000: Lowlands)"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "/common/topic/image": [],
116
+ "id": "/guid/9202a8c04000641f8000000003040304",
117
+ "name": "God Put a Smile Upon Your Face",
118
+ "release_date": null,
119
+ "release_type": "Single",
120
+ "track": [
121
+ {
122
+ "index": 0,
123
+ "name": "God Put a Smile Upon Your Face"
124
+ },
125
+ {
126
+ "index": 1,
127
+ "name": "Crests of Waves"
128
+ },
129
+ {
130
+ "index": 2,
131
+ "name": "Animals"
132
+ },
133
+ {
134
+ "index": 3,
135
+ "name": "Murder"
136
+ },
137
+ {
138
+ "index": 4,
139
+ "name": "In My Place (live)"
140
+ },
141
+ {
142
+ "index": 5,
143
+ "name": "Yellow (live)"
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "/common/topic/image": [],
149
+ "id": "/guid/9202a8c04000641f80000000030405fd",
150
+ "name": "The Remixes",
151
+ "release_date": null,
152
+ "release_type": "Remix",
153
+ "track": [
154
+ {
155
+ "index": 0,
156
+ "name": "Clocks (Airplay remix)"
157
+ },
158
+ {
159
+ "index": 1,
160
+ "name": "Clocks (R\u00f6yksopp Trembling Heart remix)"
161
+ },
162
+ {
163
+ "index": 2,
164
+ "name": "Yellow (The Alpha remix)"
165
+ },
166
+ {
167
+ "index": 3,
168
+ "name": "Clocks (Cosmos remix)"
169
+ },
170
+ {
171
+ "index": 4,
172
+ "name": "Clocks (Planet Rockers remix)"
173
+ },
174
+ {
175
+ "index": 5,
176
+ "name": "Clocks (PsyClone remix)"
177
+ },
178
+ {
179
+ "index": 6,
180
+ "name": "Spies (Nikolai Levey remix)"
181
+ },
182
+ {
183
+ "index": 7,
184
+ "name": "Clocks (Illicit White Label remix)"
185
+ },
186
+ {
187
+ "index": 8,
188
+ "name": "Clocks (Live R\u00f6yksopp remix)"
189
+ },
190
+ {
191
+ "index": 9,
192
+ "name": "Clocks (Yaron Deephouse remix)"
193
+ },
194
+ {
195
+ "index": 10,
196
+ "name": "God Put a Smile Upon Your Face (Def Inc. remix)"
197
+ },
198
+ {
199
+ "index": 11,
200
+ "name": "Clocks (Riva remix)"
201
+ },
202
+ {
203
+ "index": 12,
204
+ "name": "Clocks (R\u00f6yksopp Trembling Heart instrumental remix)"
205
+ }
206
+ ]
207
+ },
208
+ {
209
+ "/common/topic/image": [
210
+ {
211
+ "id": "/wikipedia/images/en_id/17155168"
212
+ }
213
+ ],
214
+ "id": "/en/viva_la_vida_or_death_and_all_his_friends",
215
+ "name": "Viva la Vida or Death and All His Friends",
216
+ "release_date": "2008-06-17",
217
+ "release_type": null,
218
+ "track": [
219
+ {
220
+ "index": 0,
221
+ "name": "Cemeteries of London"
222
+ },
223
+ {
224
+ "index": 1,
225
+ "name": "Lost!"
226
+ },
227
+ {
228
+ "index": 2,
229
+ "name": "42"
230
+ },
231
+ {
232
+ "index": 3,
233
+ "name": "Lovers in Japan/Reign of Love"
234
+ },
235
+ {
236
+ "index": null,
237
+ "name": "Viva la Vida"
238
+ },
239
+ {
240
+ "index": null,
241
+ "name": "Life in Technicolor"
242
+ },
243
+ {
244
+ "index": null,
245
+ "name": "Yes!/Chinese Sleep Chant"
246
+ },
247
+ {
248
+ "index": null,
249
+ "name": "Strawberry Swing"
250
+ },
251
+ {
252
+ "index": null,
253
+ "name": "Violet Hill"
254
+ },
255
+ {
256
+ "index": null,
257
+ "name": "Lost? (acoustic)"
258
+ },
259
+ {
260
+ "index": null,
261
+ "name": "Death And All His Friends"
262
+ }
263
+ ]
264
+ },
265
+ {
266
+ "/common/topic/image": [
267
+ {
268
+ "id": "/wikipedia/images/en_id/3283256"
269
+ }
270
+ ],
271
+ "id": "/guid/9202a8c04000641f80000000007da85e",
272
+ "name": "Talk",
273
+ "release_date": "2005-12-09",
274
+ "release_type": "Single",
275
+ "track": [
276
+ {
277
+ "index": 0,
278
+ "name": "Talk (album version)"
279
+ },
280
+ {
281
+ "index": 1,
282
+ "name": "Square One (live in Holland)"
283
+ },
284
+ {
285
+ "index": 2,
286
+ "name": "Clocks (live in Holland)"
287
+ }
288
+ ]
289
+ },
290
+ {
291
+ "/common/topic/image": [],
292
+ "id": "/guid/9202a8c04000641f8000000003040334",
293
+ "name": "Fix You",
294
+ "release_date": "2005-09-05",
295
+ "release_type": "Single",
296
+ "track": [
297
+ {
298
+ "index": 0,
299
+ "name": "Fix You (edit)"
300
+ },
301
+ {
302
+ "index": 1,
303
+ "name": "The World Turned Upside Down"
304
+ },
305
+ {
306
+ "index": 2,
307
+ "name": "Pour Me (live at the Hollywood Bowl)"
308
+ }
309
+ ]
310
+ },
311
+ {
312
+ "/common/topic/image": [
313
+ {
314
+ "id": "/wikipedia/images/en_id/1693480"
315
+ }
316
+ ],
317
+ "id": "/en/x_y",
318
+ "name": "X&amp;Y",
319
+ "release_date": "2005-06-01",
320
+ "release_type": null,
321
+ "track": [
322
+ {
323
+ "index": 0,
324
+ "name": "Things I Don't Understand"
325
+ },
326
+ {
327
+ "index": 1,
328
+ "name": "Proof"
329
+ },
330
+ {
331
+ "index": 2,
332
+ "name": "The World Turned Upside Down"
333
+ },
334
+ {
335
+ "index": 3,
336
+ "name": "Pour Me (live at the Hollywood Bowl)"
337
+ },
338
+ {
339
+ "index": 4,
340
+ "name": "Sleeping Sun"
341
+ },
342
+ {
343
+ "index": 5,
344
+ "name": "Gravity"
345
+ },
346
+ {
347
+ "index": 6,
348
+ "name": "Square One"
349
+ },
350
+ {
351
+ "index": 7,
352
+ "name": "What If"
353
+ },
354
+ {
355
+ "index": 8,
356
+ "name": "White Shadows"
357
+ },
358
+ {
359
+ "index": 9,
360
+ "name": "Fix You"
361
+ },
362
+ {
363
+ "index": 10,
364
+ "name": "Talk"
365
+ },
366
+ {
367
+ "index": 11,
368
+ "name": "X&amp;Y"
369
+ },
370
+ {
371
+ "index": 12,
372
+ "name": "Speed of Sound"
373
+ },
374
+ {
375
+ "index": 13,
376
+ "name": "A Message"
377
+ },
378
+ {
379
+ "index": 14,
380
+ "name": "Low"
381
+ },
382
+ {
383
+ "index": 15,
384
+ "name": "The Hardest Part"
385
+ },
386
+ {
387
+ "index": 16,
388
+ "name": "Swallowed in the Sea"
389
+ },
390
+ {
391
+ "index": 17,
392
+ "name": "Twisted Logic"
393
+ },
394
+ {
395
+ "index": 18,
396
+ "name": "'til Kingdom Come"
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "/common/topic/image": [],
402
+ "id": "/guid/9202a8c04000641f80000000030402b6",
403
+ "name": "Speed of Sound",
404
+ "release_date": "2005-05-23",
405
+ "release_type": "Single",
406
+ "track": [
407
+ {
408
+ "index": 0,
409
+ "name": "Speed of Sound (radio edit)"
410
+ },
411
+ {
412
+ "index": 1,
413
+ "name": "Speed of Sound (album version)"
414
+ }
415
+ ]
416
+ },
417
+ {
418
+ "/common/topic/image": [],
419
+ "id": "/guid/9202a8c04000641f80000000030405cb",
420
+ "name": "Talk",
421
+ "release_date": "2005",
422
+ "release_type": "Single",
423
+ "track": [
424
+ {
425
+ "index": 0,
426
+ "name": "God Put a Smile Upon Your Face (live in Holland)"
427
+ },
428
+ {
429
+ "index": 1,
430
+ "name": "Swallowed in the Sea (live in Holland)"
431
+ },
432
+ {
433
+ "index": 2,
434
+ "name": "Talk (radio edit)"
435
+ }
436
+ ]
437
+ },
438
+ {
439
+ "/common/topic/image": [
440
+ {
441
+ "id": "/wikipedia/images/en_id/1043064"
442
+ }
443
+ ],
444
+ "id": "/en/live_2003",
445
+ "name": "Live 2003",
446
+ "release_date": "2003-11-04",
447
+ "release_type": "Live Album",
448
+ "track": [
449
+ {
450
+ "index": 0,
451
+ "name": "Politik"
452
+ },
453
+ {
454
+ "index": 1,
455
+ "name": "God Put a Smile Upon Your Face"
456
+ },
457
+ {
458
+ "index": 2,
459
+ "name": "A Rush of Blood to the Head"
460
+ },
461
+ {
462
+ "index": 3,
463
+ "name": "One I Love"
464
+ },
465
+ {
466
+ "index": 4,
467
+ "name": "See You Soon"
468
+ },
469
+ {
470
+ "index": 5,
471
+ "name": "Shiver"
472
+ },
473
+ {
474
+ "index": 6,
475
+ "name": "Everything's Not Lost"
476
+ },
477
+ {
478
+ "index": 7,
479
+ "name": "Moses"
480
+ },
481
+ {
482
+ "index": 8,
483
+ "name": "Yellow"
484
+ },
485
+ {
486
+ "index": 9,
487
+ "name": "Clocks"
488
+ },
489
+ {
490
+ "index": 10,
491
+ "name": "In My Place"
492
+ },
493
+ {
494
+ "index": 11,
495
+ "name": "Amsterdam"
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "/common/topic/image": [],
501
+ "id": "/en/clocks_yellow",
502
+ "name": "Clocks / Yellow",
503
+ "release_date": "2003-06-24",
504
+ "release_type": "Single",
505
+ "track": [
506
+ {
507
+ "index": 0,
508
+ "name": "Clocks"
509
+ },
510
+ {
511
+ "index": 1,
512
+ "name": "Yellow (live)"
513
+ }
514
+ ]
515
+ },
516
+ {
517
+ "/common/topic/image": [],
518
+ "id": "/guid/9202a8c04000641f800000000304027d",
519
+ "name": "Clocks",
520
+ "release_date": "2003-03-24",
521
+ "release_type": "Single",
522
+ "track": [
523
+ {
524
+ "index": 0,
525
+ "name": "Clocks"
526
+ },
527
+ {
528
+ "index": 1,
529
+ "name": "Politik (live in Rotterdam Nov 5 2002)"
530
+ },
531
+ {
532
+ "index": 2,
533
+ "name": "Shiver (live in Rotterdam Nov 5 2002)"
534
+ },
535
+ {
536
+ "index": 3,
537
+ "name": "Daylight (live in Rotterdam Nov 5 2002)"
538
+ }
539
+ ]
540
+ },
541
+ {
542
+ "/common/topic/image": [],
543
+ "id": "/guid/9202a8c04000641f80000000030403d4",
544
+ "name": "Clocks",
545
+ "release_date": "2003",
546
+ "release_type": "EP",
547
+ "track": [
548
+ {
549
+ "index": 0,
550
+ "name": "Clocks (edit)"
551
+ },
552
+ {
553
+ "index": 1,
554
+ "name": "Crests of Waves"
555
+ },
556
+ {
557
+ "index": 2,
558
+ "name": "Animals"
559
+ },
560
+ {
561
+ "index": 3,
562
+ "name": "Murder"
563
+ },
564
+ {
565
+ "index": 4,
566
+ "name": "In My Place (live)"
567
+ },
568
+ {
569
+ "index": 5,
570
+ "name": "Yellow (live)"
571
+ }
572
+ ]
573
+ },
574
+ {
575
+ "/common/topic/image": [],
576
+ "id": "/guid/9202a8c04000641f8000000003040591",
577
+ "name": "The Scientist",
578
+ "release_date": "2002-11-11",
579
+ "release_type": "Single",
580
+ "track": [
581
+ {
582
+ "index": 0,
583
+ "name": "The Scientist"
584
+ },
585
+ {
586
+ "index": 1,
587
+ "name": "1.36"
588
+ },
589
+ {
590
+ "index": 2,
591
+ "name": "I Ran Away"
592
+ }
593
+ ]
594
+ },
595
+ {
596
+ "/common/topic/image": [
597
+ {
598
+ "id": "/wikipedia/images/en_id/7543719"
599
+ }
600
+ ],
601
+ "id": "/en/a_rush_of_blood_to_the_head",
602
+ "name": "A Rush of Blood to the Head",
603
+ "release_date": "2002-08-12",
604
+ "release_type": null,
605
+ "track": [
606
+ {
607
+ "index": 0,
608
+ "name": "Politik"
609
+ },
610
+ {
611
+ "index": 1,
612
+ "name": "In My Place"
613
+ },
614
+ {
615
+ "index": 2,
616
+ "name": "God Put a Smile upon Your Face"
617
+ },
618
+ {
619
+ "index": 3,
620
+ "name": "The Scientist"
621
+ },
622
+ {
623
+ "index": 4,
624
+ "name": "Clocks"
625
+ },
626
+ {
627
+ "index": 5,
628
+ "name": "Daylight"
629
+ },
630
+ {
631
+ "index": 6,
632
+ "name": "Green Eyes"
633
+ },
634
+ {
635
+ "index": 7,
636
+ "name": "Warning Sign"
637
+ },
638
+ {
639
+ "index": 8,
640
+ "name": "A Whisper"
641
+ },
642
+ {
643
+ "index": 9,
644
+ "name": "A Rush of Blood to the Head"
645
+ },
646
+ {
647
+ "index": 10,
648
+ "name": "Amsterdam"
649
+ }
650
+ ]
651
+ },
652
+ {
653
+ "/common/topic/image": [],
654
+ "id": "/guid/9202a8c04000641f80000000030404c5",
655
+ "name": "In My Place",
656
+ "release_date": "2002",
657
+ "release_type": "Single",
658
+ "track": [
659
+ {
660
+ "index": 0,
661
+ "name": "In My Place"
662
+ },
663
+ {
664
+ "index": 1,
665
+ "name": "One I Love"
666
+ },
667
+ {
668
+ "index": 2,
669
+ "name": "I Bloom Blaum"
670
+ }
671
+ ]
672
+ },
673
+ {
674
+ "/common/topic/image": [],
675
+ "id": "/guid/9202a8c04000641f80000000030404b0",
676
+ "name": "Trouble: Norwegian Live EP: Rockefeller Music Hall, Oslo",
677
+ "release_date": "2001",
678
+ "release_type": "EP",
679
+ "track": [
680
+ {
681
+ "index": 0,
682
+ "name": "Trouble"
683
+ },
684
+ {
685
+ "index": 1,
686
+ "name": "Shiver"
687
+ },
688
+ {
689
+ "index": 2,
690
+ "name": "Sparks"
691
+ },
692
+ {
693
+ "index": 3,
694
+ "name": "Yellow"
695
+ },
696
+ {
697
+ "index": 4,
698
+ "name": "Everything's Not Lost"
699
+ }
700
+ ]
701
+ },
702
+ {
703
+ "/common/topic/image": [
704
+ {
705
+ "id": "/wikipedia/images/en_id/1338953"
706
+ }
707
+ ],
708
+ "id": "/en/parachutes",
709
+ "name": "Parachutes",
710
+ "release_date": "2000-07-10",
711
+ "release_type": null,
712
+ "track": [
713
+ {
714
+ "index": 0,
715
+ "name": "Don't Panic"
716
+ },
717
+ {
718
+ "index": 1,
719
+ "name": "Shiver"
720
+ },
721
+ {
722
+ "index": 2,
723
+ "name": "Spies"
724
+ },
725
+ {
726
+ "index": 3,
727
+ "name": "Sparks"
728
+ },
729
+ {
730
+ "index": 4,
731
+ "name": "Yellow"
732
+ },
733
+ {
734
+ "index": 5,
735
+ "name": "Trouble"
736
+ },
737
+ {
738
+ "index": 6,
739
+ "name": "Parachutes"
740
+ },
741
+ {
742
+ "index": 7,
743
+ "name": "High Speed"
744
+ },
745
+ {
746
+ "index": 8,
747
+ "name": "We Never Change"
748
+ },
749
+ {
750
+ "index": 9,
751
+ "name": "Everything's Not Lost / Life Is for Living"
752
+ }
753
+ ]
754
+ },
755
+ {
756
+ "/common/topic/image": [],
757
+ "id": "/guid/9202a8c04000641f80000000030404d4",
758
+ "name": "Shiver",
759
+ "release_date": "2000",
760
+ "release_type": "Single",
761
+ "track": [
762
+ {
763
+ "index": 0,
764
+ "name": "Shiver"
765
+ },
766
+ {
767
+ "index": 1,
768
+ "name": "For You"
769
+ },
770
+ {
771
+ "index": 2,
772
+ "name": "Careful Where You Stand"
773
+ }
774
+ ]
775
+ },
776
+ {
777
+ "/common/topic/image": [],
778
+ "id": "/guid/9202a8c04000641f800000000304036b",
779
+ "name": "Trouble",
780
+ "release_date": "2000",
781
+ "release_type": "Single",
782
+ "track": [
783
+ {
784
+ "index": 0,
785
+ "name": "Trouble"
786
+ },
787
+ {
788
+ "index": 1,
789
+ "name": "Brothers and Sisters"
790
+ },
791
+ {
792
+ "index": 2,
793
+ "name": "Shiver (Jo Whiley Lunchtime Social)"
794
+ }
795
+ ]
796
+ },
797
+ {
798
+ "/common/topic/image": [],
799
+ "id": "/guid/9202a8c04000641f80000000030403e9",
800
+ "name": "Yellow",
801
+ "release_date": "2000",
802
+ "release_type": "Single",
803
+ "track": [
804
+ {
805
+ "index": 0,
806
+ "name": "Yellow"
807
+ },
808
+ {
809
+ "index": 1,
810
+ "name": "Help Is Round the Corner"
811
+ },
812
+ {
813
+ "index": 2,
814
+ "name": "No More Keeping My Feet on the Ground"
815
+ }
816
+ ]
817
+ },
818
+ {
819
+ "/common/topic/image": [],
820
+ "id": "/guid/9202a8c04000641f8000000003040346",
821
+ "name": "The Blue Room EP",
822
+ "release_date": "1999-10-25",
823
+ "release_type": "EP",
824
+ "track": [
825
+ {
826
+ "index": 0,
827
+ "name": "Bigger Stronger"
828
+ },
829
+ {
830
+ "index": 1,
831
+ "name": "Don't Panic"
832
+ },
833
+ {
834
+ "index": 2,
835
+ "name": "See You Soon"
836
+ },
837
+ {
838
+ "index": 3,
839
+ "name": "High Speed"
840
+ },
841
+ {
842
+ "index": 4,
843
+ "name": "Such a Rush"
844
+ }
845
+ ]
846
+ },
847
+ {
848
+ "/common/topic/image": [],
849
+ "id": "/guid/9202a8c04000641f800000000304037c",
850
+ "name": "Brothers &amp; Sisters EP",
851
+ "release_date": "1999-04",
852
+ "release_type": "EP",
853
+ "track": [
854
+ {
855
+ "index": 0,
856
+ "name": "Brothers &amp; Sisters"
857
+ },
858
+ {
859
+ "index": 1,
860
+ "name": "Easy to Please"
861
+ },
862
+ {
863
+ "index": 2,
864
+ "name": "Only Superstition"
865
+ }
866
+ ]
867
+ },
868
+ {
869
+ "/common/topic/image": [],
870
+ "id": "/guid/9202a8c04000641f800000000304031a",
871
+ "name": "Safety EP",
872
+ "release_date": "1998-05-18",
873
+ "release_type": "EP",
874
+ "track": [
875
+ {
876
+ "index": 0,
877
+ "name": "Parachutes"
878
+ },
879
+ {
880
+ "index": 1,
881
+ "name": "Bigger Stronger"
882
+ },
883
+ {
884
+ "index": 2,
885
+ "name": "No More Keeping My Feet on the Ground"
886
+ },
887
+ {
888
+ "index": 3,
889
+ "name": "Such a Rush"
890
+ }
891
+ ]
892
+ }
893
+ ],
894
+ "id": "/en/coldplay",
895
+ "name": "Coldplay",
896
+ "type": "/music/artist"
897
+ },
898
+ "status": "200 OK",
899
+ "transaction_id": "cache;cache02.p01.sjc1:8101;2009-07-01T18:06:01Z;0010"
900
+ }
901
+ body_exist: true
902
+ code: "200"
903
+ header:
904
+ vary:
905
+ - Accept-Encoding
906
+ cache-control:
907
+ - public, max-age=1, s-maxage=1, maxage-vary-cookie="3600|mwLastWriteTime"
908
+ last-modified:
909
+ - Wed, 01-Jul-2009 17:51:57 GMT
910
+ connection:
911
+ - keep-alive
912
+ x-cache:
913
+ - MISS from cache02.p01.sjc1.metaweb.com
914
+ expires:
915
+ - Wed, 01-Jul-2009 18:06:02 GMT
916
+ content-type:
917
+ - text/plain; charset=utf-8
918
+ etag:
919
+ - a2b70447c8d529b49e6b075a89d88815
920
+ date:
921
+ - Wed, 01 Jul 2009 18:06:01 GMT
922
+ x-metaweb-cost:
923
+ - cc=0.007, ch=1.0, cm=0.0, cm+h=1.0, cr=1.0, cw=0.0, dt=0.007, mcs=0.0, mcu=0.0, nvcsw=2, tm=0.0, utime=0.007
924
+ x-metaweb-success:
925
+ - 1/1
926
+ server:
927
+ - Apache
928
+ content-length:
929
+ - "20875"
930
+ age:
931
+ - "844"
932
+ x-metaweb-tid:
933
+ - cache;cache02.p01.sjc1:8101;2009-07-01T18:06:01Z;0010
934
+ http_version: "1.0"
935
+ message: OK
936
+ read: true
937
+ socket:
938
+ uri: http://www.freebase.com:80/api/service/mqlread?query=%7B%22query%22%3A%20%7B%22album%22%3A%20%5B%7B%20%22id%22%3A%20null%2C%20%22name%22%3A%20null%2C%20%22track%22%3A%20%5B%7B%20%22name%22%3A%20null%2C%20%22index%22%3A%20null%2C%20%22sort%22%3A%20%22index%22%20%7D%5D%2C%20%22release_date%22%3A%20null%2C%20%22release_type%22%3A%20null%2C%20%22sort%22%3A%20%22-release_date%22%2C%20%22%2Fcommon%2Ftopic%2Fimage%22%3A%20%5B%7B%20%22id%22%3A%20null%2C%20%22optional%22%3A%20true%2C%20%22limit%22%3A%203%20%7D%5D%20%7D%5D%2C%20%22id%22%3A%20null%2C%20%22name%22%3A%20%22coldplay%22%2C%20%22type%22%3A%20%22%2Fmusic%2Fartist%22%7D%7D