meta-spotify 0.1.0 → 0.1.1
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/HISTORY +7 -0
- data/README.markdown +65 -0
- data/Rakefile +5 -2
- data/VERSION +1 -1
- data/lib/meta-spotify.rb +0 -2
- data/meta-spotify.gemspec +12 -6
- metadata +27 -7
- data/README.rdoc +0 -61
data/HISTORY
CHANGED
data/README.markdown
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# meta-spotify
|
2
|
+
|
3
|
+
A ruby wrapper for the Spotify Metadata API. See here for usage: http://developer.spotify.com/en/metadata-api/overview/
|
4
|
+
|
5
|
+
Use of the API is subject to the Terms and Conditions: http://developer.spotify.com/en/metadata-api/terms-of-use/
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
gem install meta-spotify
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
The API has two services for the three types of data, artists, albums and tracks:
|
14
|
+
|
15
|
+
### Lookup
|
16
|
+
|
17
|
+
To look up an artist, album or track, simply call:
|
18
|
+
|
19
|
+
MetaSpotify::Artist.lookup(spotify_uri)
|
20
|
+
MetaSpotify::Album.lookup(spotify_uri)
|
21
|
+
or
|
22
|
+
MetaSpotify::Track.lookup(spotify_uri)
|
23
|
+
|
24
|
+
e.g.
|
25
|
+
|
26
|
+
artist = MetaSpotify::Artist.lookup("spotify:artist:4YrKBkKSVeqDamzBPWVnSJ")
|
27
|
+
#=> #<MetaSpotify::Artist:0x119764c @name="Basement Jaxx">
|
28
|
+
|
29
|
+
artist.name
|
30
|
+
#=> "Basement Jaxx"
|
31
|
+
|
32
|
+
You can also call lookup with the extras parameter, but only the acceptable extras will yield results, e.g.
|
33
|
+
|
34
|
+
artist = MetaSpotify::Artist.lookup('spotify:artist:4YrKBkKSVeqDamzBPWVnSJ', :extras => 'album')
|
35
|
+
|
36
|
+
artist.albums.first.name
|
37
|
+
#=> "Jaxx Unreleased"
|
38
|
+
|
39
|
+
### Search
|
40
|
+
|
41
|
+
To search for an artist, album or track works the same way as lookup, simply call:
|
42
|
+
|
43
|
+
MetaSpotify::Artist.search(search_term)
|
44
|
+
MetaSpotify::Album.search(search_term)
|
45
|
+
or
|
46
|
+
MetaSpotify::Track.search(search_term)
|
47
|
+
|
48
|
+
e.g.
|
49
|
+
|
50
|
+
search = MetaSpotify::Artist.search('foo')
|
51
|
+
|
52
|
+
search.artists.first.name
|
53
|
+
#=> "Foo fighters"
|
54
|
+
|
55
|
+
For searches with many results, the result also contains details on pages and you can return page 2 like this:
|
56
|
+
|
57
|
+
MetaSpotify::Artist.search('foo', :page => 2)
|
58
|
+
|
59
|
+
## Disclaimer
|
60
|
+
|
61
|
+
This is very new, so please let me know of any problems or anything that is missing.
|
62
|
+
|
63
|
+
## Copyright
|
64
|
+
|
65
|
+
Copyright (c) 2009 Phil Nash. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -6,14 +6,17 @@ begin
|
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "meta-spotify"
|
8
8
|
gem.summary = %Q{A ruby wrapper for the Spotify Metadata API}
|
9
|
-
gem.description = %Q{A ruby wrapper for the Spotify Metadata API}
|
10
9
|
gem.email = "philnash@gmail.com"
|
11
10
|
gem.homepage = "http://github.com/philnash/meta-spotify"
|
12
|
-
gem.authors = ["
|
11
|
+
gem.authors = ["Phil Nash"]
|
12
|
+
gem.add_dependency('httparty')
|
13
13
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
+
gem.add_development_dependency "fakeweb"
|
15
|
+
gem.rubyforge_project = 'meta-spotify'
|
14
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
17
|
end
|
16
18
|
Jeweler::GemcutterTasks.new
|
19
|
+
Jeweler::RubyforgeTasks.new
|
17
20
|
rescue LoadError
|
18
21
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
19
22
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/meta-spotify.rb
CHANGED
data/meta-spotify.gemspec
CHANGED
@@ -5,23 +5,22 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{meta-spotify}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["
|
12
|
-
s.date = %q{2009-
|
13
|
-
s.description = %q{A ruby wrapper for the Spotify Metadata API}
|
11
|
+
s.authors = ["Phil Nash"]
|
12
|
+
s.date = %q{2009-11-08}
|
14
13
|
s.email = %q{philnash@gmail.com}
|
15
14
|
s.extra_rdoc_files = [
|
16
15
|
"LICENSE",
|
17
|
-
"README.
|
16
|
+
"README.markdown"
|
18
17
|
]
|
19
18
|
s.files = [
|
20
19
|
".document",
|
21
20
|
".gitignore",
|
22
21
|
"HISTORY",
|
23
22
|
"LICENSE",
|
24
|
-
"README.
|
23
|
+
"README.markdown",
|
25
24
|
"Rakefile",
|
26
25
|
"VERSION",
|
27
26
|
"lib/meta-spotify.rb",
|
@@ -44,6 +43,7 @@ Gem::Specification.new do |s|
|
|
44
43
|
s.homepage = %q{http://github.com/philnash/meta-spotify}
|
45
44
|
s.rdoc_options = ["--charset=UTF-8"]
|
46
45
|
s.require_paths = ["lib"]
|
46
|
+
s.rubyforge_project = %q{meta-spotify}
|
47
47
|
s.rubygems_version = %q{1.3.5}
|
48
48
|
s.summary = %q{A ruby wrapper for the Spotify Metadata API}
|
49
49
|
s.test_files = [
|
@@ -58,12 +58,18 @@ Gem::Specification.new do |s|
|
|
58
58
|
s.specification_version = 3
|
59
59
|
|
60
60
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
61
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0"])
|
61
62
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
63
|
+
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
62
64
|
else
|
65
|
+
s.add_dependency(%q<httparty>, [">= 0"])
|
63
66
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
67
|
+
s.add_dependency(%q<fakeweb>, [">= 0"])
|
64
68
|
end
|
65
69
|
else
|
70
|
+
s.add_dependency(%q<httparty>, [">= 0"])
|
66
71
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
72
|
+
s.add_dependency(%q<fakeweb>, [">= 0"])
|
67
73
|
end
|
68
74
|
end
|
69
75
|
|
metadata
CHANGED
@@ -1,17 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta-spotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Phil Nash
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-08 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: httparty
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
15
25
|
- !ruby/object:Gem::Dependency
|
16
26
|
name: thoughtbot-shoulda
|
17
27
|
type: :development
|
@@ -22,7 +32,17 @@ dependencies:
|
|
22
32
|
- !ruby/object:Gem::Version
|
23
33
|
version: "0"
|
24
34
|
version:
|
25
|
-
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: fakeweb
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
description:
|
26
46
|
email: philnash@gmail.com
|
27
47
|
executables: []
|
28
48
|
|
@@ -30,13 +50,13 @@ extensions: []
|
|
30
50
|
|
31
51
|
extra_rdoc_files:
|
32
52
|
- LICENSE
|
33
|
-
- README.
|
53
|
+
- README.markdown
|
34
54
|
files:
|
35
55
|
- .document
|
36
56
|
- .gitignore
|
37
57
|
- HISTORY
|
38
58
|
- LICENSE
|
39
|
-
- README.
|
59
|
+
- README.markdown
|
40
60
|
- Rakefile
|
41
61
|
- VERSION
|
42
62
|
- lib/meta-spotify.rb
|
@@ -78,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
98
|
version:
|
79
99
|
requirements: []
|
80
100
|
|
81
|
-
rubyforge_project:
|
101
|
+
rubyforge_project: meta-spotify
|
82
102
|
rubygems_version: 1.3.5
|
83
103
|
signing_key:
|
84
104
|
specification_version: 3
|
data/README.rdoc
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
= meta-spotify
|
2
|
-
|
3
|
-
A ruby wrapper for the Spotify Metadata API. See here for usage: http://developer.spotify.com/en/metadata-api/overview/
|
4
|
-
|
5
|
-
Use of the API is subject to the Terms and Conditions: http://developer.spotify.com/en/metadata-api/terms-of-use/
|
6
|
-
|
7
|
-
== Usage
|
8
|
-
|
9
|
-
The API has two services for the three types of data, artists, albums and tracks:
|
10
|
-
|
11
|
-
=== Lookup
|
12
|
-
|
13
|
-
To look up an artist, album or track, simply call:
|
14
|
-
|
15
|
-
MetaSpotify::Artist.lookup(spotify_uri)
|
16
|
-
MetaSpotify::Album.lookup(spotify_uri)
|
17
|
-
or
|
18
|
-
MetaSpotify::Track.lookup(spotify_uri)
|
19
|
-
|
20
|
-
e.g.
|
21
|
-
|
22
|
-
artist = MetaSpotify::Artist.lookup("spotify:artist:4YrKBkKSVeqDamzBPWVnSJ")
|
23
|
-
#=> #<MetaSpotify::Artist:0x119764c @name="Basement Jaxx">
|
24
|
-
|
25
|
-
artist.name
|
26
|
-
#=> "Basement Jaxx"
|
27
|
-
|
28
|
-
You can also call lookup with the extras parameter, but only the acceptable extras will yield results, e.g.
|
29
|
-
|
30
|
-
artist = MetaSpotify::Artist.lookup('spotify:artist:4YrKBkKSVeqDamzBPWVnSJ', :extras => 'album')
|
31
|
-
|
32
|
-
artist.albums.first.name
|
33
|
-
#=> "Jaxx Unreleased"
|
34
|
-
|
35
|
-
=== Search
|
36
|
-
|
37
|
-
To search for an artist, album or track works the same way as lookup, simply call:
|
38
|
-
|
39
|
-
MetaSpotify::Artist.search(search_term)
|
40
|
-
MetaSpotify::Album.search(search_term)
|
41
|
-
or
|
42
|
-
MetaSpotify::Track.search(search_term)
|
43
|
-
|
44
|
-
e.g.
|
45
|
-
|
46
|
-
search = MetaSpotify::Artist.search('foo')
|
47
|
-
|
48
|
-
search.artists.first.name
|
49
|
-
#=> "Foo fighters"
|
50
|
-
|
51
|
-
For searches with many results, the result also contains details on pages and you can return page 2 like this:
|
52
|
-
|
53
|
-
MetaSpotify::Artist.search('foo', :page => 2)
|
54
|
-
|
55
|
-
== Disclaimer
|
56
|
-
|
57
|
-
This is very new, so please let me know of any problems or anything that is missing.
|
58
|
-
|
59
|
-
== Copyright
|
60
|
-
|
61
|
-
Copyright (c) 2009 Phil Nash. See LICENSE for details.
|