alexa_couchpotato 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/README.md +26 -0
- data/alexa_couchpotato.gemspec +2 -1
- data/lib/alexa_couchpotato.rb +4 -7
- data/lib/alexa_couchpotato/version.rb +1 -1
- metadata +19 -6
- data/.DS_Store +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e356f896238345fda48ecbfe32c1f7fbb5bb6290
|
|
4
|
+
data.tar.gz: 2ee856b691fd3912242722036ebba8531f035931
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a0a8b27fb90dc481e3ef05bdb754ba3994e569dc4108b20a9df7a78d33a750f0ca6a0e63bafb8f2379d1e724c934889f696d72c4bfb5c26ef76d3922cbf05f4
|
|
7
|
+
data.tar.gz: 44fb299f131f9aeb66c549b06c5ac33fa90d0063f74d401f7eb25d08996e3240e6821fba79df7c7df9033c120b66e0345b1c0946daa8219736a55e53b6eeb26d
|
data/Gemfile
CHANGED
data/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Alexa Couchpotato
|
|
2
|
+
[](http://badge.fury.io/rb/alexa_couchpotato)
|
|
3
|
+
[](https://codeclimate.com/github/kylegrantlucas/alexa_couchpotato)
|
|
4
|
+
|
|
5
|
+
A SingingAssistant plugin for using Alexa commands with CouchPotato. 🎥
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Add this line to your SingingAssistant installation's Gemfile:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
gem 'alexa_couchpotato'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
TODO: Write usage instructions here
|
|
18
|
+
|
|
19
|
+
## Contributing
|
|
20
|
+
|
|
21
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kylegrantlucas/alexa_couchpotato. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
26
|
+
|
data/alexa_couchpotato.gemspec
CHANGED
|
@@ -21,7 +21,8 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
|
|
22
22
|
spec.add_runtime_dependency 'json'
|
|
23
23
|
spec.add_runtime_dependency 'alexa_objects'
|
|
24
|
-
spec.add_runtime_dependency '
|
|
24
|
+
spec.add_runtime_dependency 'curb'
|
|
25
|
+
spec.add_runtime_dependency 'oj'
|
|
25
26
|
spec.add_runtime_dependency 'numbers_in_words'
|
|
26
27
|
spec.add_runtime_dependency 'activesupport'
|
|
27
28
|
spec.add_runtime_dependency 'chronic'
|
data/lib/alexa_couchpotato.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
require 'alexa_objects'
|
|
3
|
-
require '
|
|
3
|
+
require 'curb'
|
|
4
|
+
require 'oj'
|
|
4
5
|
require 'numbers_in_words'
|
|
5
6
|
require 'numbers_in_words/duck_punch'
|
|
6
7
|
require 'active_support'
|
|
@@ -29,7 +30,7 @@ module Couchpotato
|
|
|
29
30
|
end
|
|
30
31
|
end
|
|
31
32
|
|
|
32
|
-
query =
|
|
33
|
+
query = Oj.load(Curl.get(URI.escape("#{search_endpoint}?q=#{title}").body_str)) rescue nil
|
|
33
34
|
|
|
34
35
|
if query["movies"] && query["movies"].count == 1
|
|
35
36
|
movie = query["movies"].first
|
|
@@ -54,8 +55,6 @@ module Couchpotato
|
|
|
54
55
|
@@movies = movie
|
|
55
56
|
response.end_session = false
|
|
56
57
|
response.reprompt_text = "Which movie would you like me to download? #{movie.map {|m| m["titles"].first }.to_sentence(:last_word_connector => ' or ')}"
|
|
57
|
-
elsif movie == false
|
|
58
|
-
response.spoken_response = "sorry, I wasn't able to find #{@echo_request.slots["movie"]} because the search came up empty"
|
|
59
58
|
else
|
|
60
59
|
response.spoken_response = "sorry, I wasn't able to find #{@echo_request.slots["movie"]} because the search came up empty"
|
|
61
60
|
end
|
|
@@ -71,9 +70,7 @@ module Couchpotato
|
|
|
71
70
|
response = AlexaObjects::Response.new
|
|
72
71
|
if movie != false && query["success"] = true
|
|
73
72
|
response.spoken_response = "okay, downloading #{movie["titles"].first}"
|
|
74
|
-
|
|
75
|
-
response.spoken_response = "sorry, I wasn't able to find #{@echo_request.slots["movie"]} because the search came up empty"
|
|
76
|
-
elsif movie && query["success"] = false
|
|
73
|
+
else
|
|
77
74
|
response.spoken_response = "sorry, I wasn't able to find #{@echo_request.slots["movie"]} because it wouldn't add to the server"
|
|
78
75
|
end
|
|
79
76
|
response.to_json
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alexa_couchpotato
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kyle Lucas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -39,7 +39,21 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: curb
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: oj
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
59
|
- - ">="
|
|
@@ -185,10 +199,10 @@ executables: []
|
|
|
185
199
|
extensions: []
|
|
186
200
|
extra_rdoc_files: []
|
|
187
201
|
files:
|
|
188
|
-
- ".DS_Store"
|
|
189
202
|
- ".gitignore"
|
|
190
203
|
- Gemfile
|
|
191
204
|
- Guardfile
|
|
205
|
+
- README.md
|
|
192
206
|
- Rakefile
|
|
193
207
|
- alexa_couchpotato.gemspec
|
|
194
208
|
- lib/alexa_couchpotato.rb
|
|
@@ -220,9 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
220
234
|
version: '0'
|
|
221
235
|
requirements: []
|
|
222
236
|
rubyforge_project:
|
|
223
|
-
rubygems_version: 2.
|
|
237
|
+
rubygems_version: 2.5.1
|
|
224
238
|
signing_key:
|
|
225
239
|
specification_version: 4
|
|
226
240
|
summary: A sinatra middleware for alexa couhpotato actions.
|
|
227
241
|
test_files: []
|
|
228
|
-
has_rdoc:
|
data/.DS_Store
DELETED
|
Binary file
|