next-big-sound 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/next-big-sound/artist.rb +25 -8
- data/next-big-sound.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
@@ -36,7 +36,7 @@ module NBS
|
|
36
36
|
#puts self.to_xml
|
37
37
|
#puts self.to_xml
|
38
38
|
@profs ||= long_function
|
39
|
-
|
39
|
+
return @profs
|
40
40
|
end
|
41
41
|
def long_function
|
42
42
|
profs={}
|
@@ -78,13 +78,30 @@ module NBS
|
|
78
78
|
def to_hash
|
79
79
|
Hash.from_xml(self.to_xml)
|
80
80
|
end
|
81
|
+
def youtube_videos
|
82
|
+
@youtube_fetch ||= Net::HTTP.get(URI.parse("#{$nbs_api_key}youtube/artist/#{self.artist_id}.xml")).to_s
|
83
|
+
h = Hash.from_xml(@youtube_fetch)
|
81
84
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
85
|
+
arr =[]
|
86
|
+
begin
|
87
|
+
h["data"][0]["youtubes"][0]["youtube"].each do |g|
|
88
|
+
arr << g["url"].to_s
|
89
|
+
end
|
90
|
+
rescue
|
91
|
+
end
|
92
|
+
return arr
|
93
|
+
end
|
94
|
+
def genres
|
95
|
+
@genre_fetch ||= Net::HTTP.get(URI.parse("#{$nbs_api_key}genres/artist/#{self.artist_id}.xml")).to_s
|
96
|
+
h = Hash.from_xml(@genre_fetch)
|
97
|
+
arr =[]
|
98
|
+
begin
|
99
|
+
h["data"][0]["genres"][0]["genre"].each do |g|
|
100
|
+
arr << g["name"].to_s
|
101
|
+
end
|
102
|
+
rescue
|
103
|
+
end
|
104
|
+
return arr
|
105
|
+
end
|
89
106
|
end
|
90
107
|
end
|
data/next-big-sound.gemspec
CHANGED