robbie 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/robbie/request.rb +6 -2
- data/lib/robbie/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac03016b8572101ecb13799dc7deea787df0e991
|
4
|
+
data.tar.gz: 11f25b14bd3442ce863e4983b34cef532a22efb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dfb4bd4161551c0de79ae4a7e4a6a630393482ca786a80ec4be819c6c81322d261458bf193dd64ae1f4f658af5cb5107673d1964fd4220ddeb2e1b2403d35e5
|
7
|
+
data.tar.gz: 229fe1d903d2a827abe6b6062626bef2365a3515256a87bed84ffaf201a6dd91aa1e41bffc09c5ff5a2a14e43289bd79cbd777fdf01635e3cd204540d0271574
|
data/lib/robbie/request.rb
CHANGED
@@ -38,11 +38,15 @@ module Request
|
|
38
38
|
@res = HTTP.get("http://ws.audioscrobbler.com/2.0/?method=track.getInfo&track=#{@song}&artist=#{@artist}&api_key=0a7d3b25ed857f679eba1a353e98a658&format=json").body
|
39
39
|
@json = JSON.parse(@res)
|
40
40
|
|
41
|
-
|
41
|
+
if @year = @json['track']['wiki'].nil?
|
42
|
+
@year = "Not Available"
|
43
|
+
else
|
44
|
+
@year = @json['track']['wiki']['published']
|
45
|
+
end
|
42
46
|
|
43
47
|
puts "Title: \t\t#{@json['track']['name']}"
|
44
48
|
puts "Artist: \t#{@json['track']['artist']['name']}"
|
45
|
-
|
49
|
+
puts "Year: \t\t#{@year}"
|
46
50
|
puts "Duration: \t#{@json['track']['duration'].to_i/1000} seconds"
|
47
51
|
end
|
48
52
|
|
data/lib/robbie/version.rb
CHANGED