next-big-sound-lite 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/lib/next-big-sound-lite.rb +18 -9
- data/next-big-sound-lite.gemspec +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -6,7 +6,7 @@ Done? Then you can use this API.
|
|
6
6
|
|
7
7
|
First setup the gem to use your API key:
|
8
8
|
|
9
|
-
NBS
|
9
|
+
NBS.api_key = 'your_key'
|
10
10
|
|
11
11
|
The methods of this wrapper are organized in the same way as the subsections of the API docs. For example to call the resource 'view' on Artists you should call:
|
12
12
|
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'rake'
|
4
4
|
require 'echoe'
|
5
5
|
|
6
|
-
Echoe.new('next-big-sound-lite', '0.1.
|
6
|
+
Echoe.new('next-big-sound-lite', '0.1.6') do |p|
|
7
7
|
p.description = "Thin wrapper for the Next Big Sound API."
|
8
8
|
p.url = "http://github.com/rpbertp13/next-big-sound-lite"
|
9
9
|
p.author = "Roberto Thais"
|
data/lib/next-big-sound-lite.rb
CHANGED
@@ -3,12 +3,21 @@ require 'json'
|
|
3
3
|
|
4
4
|
#for version 2.0 of the NBS API
|
5
5
|
module NBS
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
|
8
|
+
def self.api_key=(key)
|
9
|
+
@base = RestClient::Resource.new("http://#{key}.api2.nextbigsound.com")
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.base
|
13
|
+
@base
|
14
|
+
end
|
15
|
+
|
16
|
+
self.api_key = 'key'
|
8
17
|
|
9
18
|
class Artist
|
10
19
|
|
11
|
-
@resource =
|
20
|
+
@resource = NBS.base['artists']
|
12
21
|
|
13
22
|
def self.view(id)
|
14
23
|
res = @resource["view/#{id}.json"].get
|
@@ -30,7 +39,7 @@ module NBS
|
|
30
39
|
|
31
40
|
class Genre
|
32
41
|
|
33
|
-
@resource =
|
42
|
+
@resource = NBS.base['genres']
|
34
43
|
|
35
44
|
def self.artist(id)
|
36
45
|
res = @resource["artist/#{id}.json"].get
|
@@ -40,7 +49,7 @@ module NBS
|
|
40
49
|
|
41
50
|
class Metric
|
42
51
|
|
43
|
-
@resource =
|
52
|
+
@resource = NBS.base['metrics']
|
44
53
|
|
45
54
|
def self.profile(id)
|
46
55
|
res = @resource["profile/#{id}.json"].get
|
@@ -55,7 +64,7 @@ module NBS
|
|
55
64
|
|
56
65
|
class Profile
|
57
66
|
|
58
|
-
@resource =
|
67
|
+
@resource = NBS.base['profiles']
|
59
68
|
|
60
69
|
def self.artist(id)
|
61
70
|
res = @resource["artist/#{id}.json"].get
|
@@ -70,7 +79,7 @@ module NBS
|
|
70
79
|
|
71
80
|
class Service
|
72
81
|
|
73
|
-
@resource =
|
82
|
+
@resource = NBS.base['services']
|
74
83
|
|
75
84
|
def self.list
|
76
85
|
JSON.parse(@resource['.json'].get)
|
@@ -80,7 +89,7 @@ module NBS
|
|
80
89
|
|
81
90
|
class Track
|
82
91
|
|
83
|
-
@resource =
|
92
|
+
@resource = NBS.base['tracks']
|
84
93
|
|
85
94
|
def self.artist(id)
|
86
95
|
res = @resource["artist/#{id}.json"].get
|
@@ -96,7 +105,7 @@ module NBS
|
|
96
105
|
|
97
106
|
class Youtube
|
98
107
|
|
99
|
-
@resource =
|
108
|
+
@resource = NBS.base['youtube']
|
100
109
|
|
101
110
|
def self.artist(id)
|
102
111
|
res = @resource["artist/#{id}.json"].get
|
data/next-big-sound-lite.gemspec
CHANGED