robbie 2.1.2 → 2.1.3
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 +12 -4
- 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: 5b9b52200d4521e75aea2d69bafd050f09d47abe
|
4
|
+
data.tar.gz: 136c5cd1c08b207cd4d503e35787506bdf7730c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dddf4d28eb6898e3b98e35dafd31b536ca702969f65eaf2ce5886cb358a244f0bfcae5615b1fc317a8056c4c55ffa984e3c1c054b9ddab504296f622b0d0cc42
|
7
|
+
data.tar.gz: 7118329fd3cc0d1d00d34c2ebcbdbd79ac1750d51bcaed155f95c7fcf43db6d3f0fafaca5d6b65b70756ba144f4753c3ac3e4d4cef819d453175a2dba9f1436e
|
data/lib/robbie/request.rb
CHANGED
@@ -6,6 +6,8 @@ require 'goodreads'
|
|
6
6
|
require 'canistreamit'
|
7
7
|
require 'bitly'
|
8
8
|
|
9
|
+
require 'awesome_print'
|
10
|
+
|
9
11
|
module Request
|
10
12
|
module_function
|
11
13
|
|
@@ -36,10 +38,12 @@ module Request
|
|
36
38
|
@res = HTTP.get("http://ws.audioscrobbler.com/2.0/?method=track.getInfo&track=#{@song}&artist=#{@artist}&api_key=0a7d3b25ed857f679eba1a353e98a658&format=json").body
|
37
39
|
@json = JSON.parse(@res)
|
38
40
|
|
41
|
+
#@year = @json['track']['wiki']['published'] || "No Year data available"
|
42
|
+
|
39
43
|
puts "Title: \t\t#{@json['track']['name']}"
|
40
44
|
puts "Artist: \t#{@json['track']['artist']['name']}"
|
41
|
-
puts "Year: \t\t#{@
|
42
|
-
puts "Duration: \t#{@json['track']['duration']}"
|
45
|
+
# puts "Year: \t\t#{@year}"
|
46
|
+
puts "Duration: \t#{@json['track']['duration'].to_i/1000} seconds"
|
43
47
|
end
|
44
48
|
|
45
49
|
def album(args) # works, sort of
|
@@ -91,8 +95,12 @@ module Request
|
|
91
95
|
Bitly.use_api_version_3
|
92
96
|
|
93
97
|
bitly = Bitly.new('benp51', 'R_886e9ca24b25c1e91d66f5c6379568a9')
|
94
|
-
|
95
|
-
|
98
|
+
|
99
|
+
titleClean = title.first
|
100
|
+
overwrittenTitle = URI.escape(title.first)
|
101
|
+
canistreamit = client.search_and_query(titleClean, ["streaming"])
|
102
|
+
|
103
|
+
omdbData = JSON.parse(HTTP.get('http://www.omdbapi.com/?t='+overwrittenTitle+'&type=series&plot=short&r=json').body)
|
96
104
|
puts "Title:\t\t#{omdbData["Title"]}"
|
97
105
|
puts "Plot:\t\t#{omdbData["Plot"]}"
|
98
106
|
puts "Poster:\t\t#{bitly.shorten(omdbData["Poster"]).short_url}"
|
data/lib/robbie/version.rb
CHANGED