lastfm 1.18.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -0
- data/lastfm.gemspec +1 -1
- data/lib/lastfm/method_category/artist.rb +11 -0
- data/spec/fixtures/artist_get_top_tags.xml +30 -0
- data/spec/method_specs/artist_spec.rb +19 -0
- metadata +6 -4
data/README.rdoc
CHANGED
@@ -36,6 +36,7 @@ It supports methods which require {authentication}[http://www.last.fm/api/authen
|
|
36
36
|
* {artist.getTags}[http://www.last.fm/api/show?service=267]
|
37
37
|
* {artist.getTopAlbums}[http://www.last.fm/api/show/artist.getTopAlbums]
|
38
38
|
* {artist.getTopFans}[http://www.last.fm/api/show/artist.getTopFans]
|
39
|
+
* {artist.getTopTags}[http://www.last.fm/api/show/artist.getTopTags]
|
39
40
|
* {artist.getTopTracks}[http://www.last.fm/api/show/artist.getTopTracks]
|
40
41
|
* {artist.search}[http://www.lastfm.jp/api/show/artist.search]
|
41
42
|
|
data/lastfm.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
13
|
gem.name = %q{lastfm}
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = "1.
|
15
|
+
gem.version = "1.19.0"
|
16
16
|
|
17
17
|
gem.add_dependency "xml-simple"
|
18
18
|
gem.add_dependency "httparty"
|
@@ -61,6 +61,17 @@ class Lastfm
|
|
61
61
|
response.xml['topfans']['user']
|
62
62
|
end
|
63
63
|
|
64
|
+
regular_method(
|
65
|
+
:get_top_tags,
|
66
|
+
:required => [:artist],
|
67
|
+
:optional => [
|
68
|
+
[:mbid, nil],
|
69
|
+
[:autocorrect, nil]
|
70
|
+
]
|
71
|
+
) do |response|
|
72
|
+
response.xml['toptags']['tag']
|
73
|
+
end
|
74
|
+
|
64
75
|
regular_method(
|
65
76
|
:search,
|
66
77
|
:required => [:artist],
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<lfm status="ok">
|
3
|
+
<toptags artist="Giorgio Moroder">
|
4
|
+
<tag>
|
5
|
+
<name>electronic</name>
|
6
|
+
<count>100</count>
|
7
|
+
<url>http://www.last.fm/tag/electronic</url>
|
8
|
+
</tag>
|
9
|
+
<tag>
|
10
|
+
<name>Disco</name>
|
11
|
+
<count>97</count>
|
12
|
+
<url>http://www.last.fm/tag/disco</url>
|
13
|
+
</tag>
|
14
|
+
<tag>
|
15
|
+
<name>synthpop</name>
|
16
|
+
<count>63</count>
|
17
|
+
<url>http://www.last.fm/tag/synthpop</url>
|
18
|
+
</tag>
|
19
|
+
<tag>
|
20
|
+
<name>Soundtrack</name>
|
21
|
+
<count>51</count>
|
22
|
+
<url>http://www.last.fm/tag/soundtrack</url>
|
23
|
+
</tag>
|
24
|
+
<tag>
|
25
|
+
<name>80s</name>
|
26
|
+
<count>43</count>
|
27
|
+
<url>http://www.last.fm/tag/80s</url>
|
28
|
+
</tag>
|
29
|
+
</toptags>
|
30
|
+
</lfm>
|
@@ -130,6 +130,25 @@ describe '#artist' do
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
133
|
+
describe '#get_top_tags' do
|
134
|
+
it 'should get artist top tags' do
|
135
|
+
@lastfm.should_receive(:request).with('artist.getTopTags', {
|
136
|
+
:artist => 'Giorgio Moroder',
|
137
|
+
:mbid => nil,
|
138
|
+
:autocorrect => nil
|
139
|
+
}).and_return(make_response('artist_get_top_tags'))
|
140
|
+
|
141
|
+
tags = @lastfm.artist.get_top_tags(:artist => 'Giorgio Moroder')
|
142
|
+
tags.size.should == 5
|
143
|
+
tags[0]['name'].should == 'electronic'
|
144
|
+
tags[0]['count'].should == '100'
|
145
|
+
tags[0]['url'].should == 'http://www.last.fm/tag/electronic'
|
146
|
+
tags[1]['name'].should == 'Disco'
|
147
|
+
tags[1]['count'].should == '97'
|
148
|
+
tags[1]['url'].should == 'http://www.last.fm/tag/disco'
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
133
152
|
describe '#search' do
|
134
153
|
it 'should search' do
|
135
154
|
@lastfm.should_receive(:request).with('artist.search', {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lastfm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.19.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: xml-simple
|
@@ -132,6 +132,7 @@ files:
|
|
132
132
|
- spec/fixtures/artist_get_tags.xml
|
133
133
|
- spec/fixtures/artist_get_top_albums.xml
|
134
134
|
- spec/fixtures/artist_get_top_fans.xml
|
135
|
+
- spec/fixtures/artist_get_top_tags.xml
|
135
136
|
- spec/fixtures/artist_get_top_tracks.xml
|
136
137
|
- spec/fixtures/artist_search.xml
|
137
138
|
- spec/fixtures/chart_get_hyped_artists.xml
|
@@ -209,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
210
|
version: '0'
|
210
211
|
segments:
|
211
212
|
- 0
|
212
|
-
hash:
|
213
|
+
hash: 484988328428045447
|
213
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
215
|
none: false
|
215
216
|
requirements:
|
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
219
|
version: '0'
|
219
220
|
segments:
|
220
221
|
- 0
|
221
|
-
hash:
|
222
|
+
hash: 484988328428045447
|
222
223
|
requirements: []
|
223
224
|
rubyforge_project:
|
224
225
|
rubygems_version: 1.8.24
|
@@ -234,6 +235,7 @@ test_files:
|
|
234
235
|
- spec/fixtures/artist_get_tags.xml
|
235
236
|
- spec/fixtures/artist_get_top_albums.xml
|
236
237
|
- spec/fixtures/artist_get_top_fans.xml
|
238
|
+
- spec/fixtures/artist_get_top_tags.xml
|
237
239
|
- spec/fixtures/artist_get_top_tracks.xml
|
238
240
|
- spec/fixtures/artist_search.xml
|
239
241
|
- spec/fixtures/chart_get_hyped_artists.xml
|