alexa_couchpotato 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alexa_couchpotato/version.rb +1 -1
- data/lib/alexa_couchpotato.rb +5 -5
- 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: 54d8ac62adbbbc7e723a4f0fc0d5bbdf7e65e62b
|
4
|
+
data.tar.gz: b85ff938ddc1b27cf398f4aa2a33f9e375065c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a278ecbdf177bbeb3c726b7b09dfbc4e188c9ee904aeceb1f1751a282365f561e700a060d9732ea7db1cce62e1c676cbf4c52e9f4ed24771bd52f152234d7468
|
7
|
+
data.tar.gz: 698ced9487cd001b50d0296c5caa3b739fc0588f9aec37f73b904fba4a478c3c3f332029f06c7569c598df89d275828d4ebddc317c6ce85dc877b19c8a011725
|
data/lib/alexa_couchpotato.rb
CHANGED
@@ -20,7 +20,7 @@ module Sinatra
|
|
20
20
|
@application_id = @echo_request.application_id
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
24
|
app.post '/alexa_cp' do
|
25
25
|
content_type :json
|
26
26
|
|
@@ -33,7 +33,7 @@ module Sinatra
|
|
33
33
|
response.without_card.to_json
|
34
34
|
puts @echo_request.slots
|
35
35
|
elsif @echo_request.intent_name == "ControlCouchpotato"
|
36
|
-
count =
|
36
|
+
count = 1URI.escape(
|
37
37
|
begin
|
38
38
|
case count
|
39
39
|
when 1
|
@@ -47,7 +47,7 @@ module Sinatra
|
|
47
47
|
title << " " unless index == word_arr.length-1
|
48
48
|
end
|
49
49
|
end
|
50
|
-
query = HTTParty.get("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/search?q=#{title}")
|
50
|
+
query = HTTParty.get(URI.escape("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/search?q=#{title}"))
|
51
51
|
if query["movies"] && query["movies"].count == 1
|
52
52
|
movie = query["movies"].first
|
53
53
|
elsif query["movies"] && query["movies"].count > 1
|
@@ -59,7 +59,7 @@ module Sinatra
|
|
59
59
|
response = AlexaObjects::Response.new
|
60
60
|
|
61
61
|
if [movie].flatten(1).count == 1 && movie != false
|
62
|
-
add_query = HTTParty.get("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/movie.add?title=#{movie["titles"].first}&identifier#{movie["imdb"]}")
|
62
|
+
add_query = HTTParty.get(URI.escape("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/movie.add?title=#{movie["titles"].first}&identifier#{movie["imdb"]}"))
|
63
63
|
if add_query["success"] = true
|
64
64
|
response.end_session = true
|
65
65
|
response.spoken_response = "okay, downloading #{movie["titles"].first}"
|
@@ -84,7 +84,7 @@ module Sinatra
|
|
84
84
|
ordinal = Chronic::Numerizer.numerize(@echo_request.slots["listvalue"]).split(' ').last
|
85
85
|
number = ordinal[0]
|
86
86
|
movie = @@movies[number.to_i+1]
|
87
|
-
query = HTTParty.get("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/movie.add?title=#{movie["titles"].first}&identifier#{movie["imdb"]}")
|
87
|
+
query = HTTParty.get(URI.escape("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/movie.add?title=#{movie["titles"].first}&identifier#{movie["imdb"]}"))
|
88
88
|
response = AlexaObjects::Response.new
|
89
89
|
if movie != false && query["success"] = true
|
90
90
|
response.end_session = true
|