alexa_couchpotato 1.0.10 → 1.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38b12e5cbe0fea4bd99fb95f2ee3fb412278fc15
4
- data.tar.gz: fd8183b22073e27fb8f1aab6f9b7f945aa811323
3
+ metadata.gz: d568fad099edc81516602945f8badf378a7cd8f7
4
+ data.tar.gz: 6f844bddfde66eb0ab31e0a83092ff1696f061ff
5
5
  SHA512:
6
- metadata.gz: dc28962f7c9788722d32992f7dbc6d908656e662168d6509c7cdb003f47d689e8df5e937b3ca03b06f7829c2528e13ec4a55d9b724d31aa626aa369dcaf8318d
7
- data.tar.gz: 943a4a6a5f05a3c25ec9dbcbf6317d5cb52d237b21635eaa7ac943fcd0f769ef6aa994ba6ff5d0f636ae4427214e20c34d8ffdb68080e0c2168517efa586660f
6
+ metadata.gz: 7238cdcc8894e276f3ba8b69abf71a6120dfac01c774dfa08ad2bbfd5ab4c0b2895164813933ef4f0bc4b7cf7b916efabc79a7b506ae12720ebe53f8e2c50c47
7
+ data.tar.gz: c58ff7b238c2eed8a29de47c0b95af4f2c09d73a3a7fad10b7d474de5b6f37d7a76af095762d957b39c99add2a8a97c4ef09dfa8bf11bc05652656d238b1791a
data/.DS_Store ADDED
Binary file
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.files = `git ls-files -z`.split("\x0")
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ["lib", 'skills_config']
21
21
 
22
22
  spec.add_runtime_dependency 'json'
23
23
  spec.add_runtime_dependency 'alexa_objects'
@@ -12,19 +12,12 @@ require 'sinatra/base'
12
12
  module Sinatra
13
13
  module Couchpotato
14
14
  def self.registered(app)
15
- app.before do
16
- if request.request_method == "POST"
17
- @data = request.body.read
18
- params.merge!(JSON.parse(@data))
19
- @echo_request = AlexaObjects::EchoRequest.new(JSON.parse(@data))
20
- @application_id = @echo_request.application_id
21
- end
22
- end
23
-
24
15
  app.post '/alexa_cp' do
25
16
  content_type :json
17
+ search_endpoint = "http://#{settings.config.couchpotato.url}/movies/api/#{settings.config.couchpotato.api_key}/search"
18
+ add_endpoint = "http://#{settings.config.couchpotato.url}/movies/api/#{settings.config.couchpotato.api_key}/movie.add"
26
19
 
27
- # halt 400, "Invalid Application ID" unless @application_id == "your application id here"
20
+ #halt 400, "" unless settings.config.application_id && @application_id == settings.config.application_id
28
21
 
29
22
  if @echo_request.launch_request?
30
23
  response = AlexaObjects::Response.new
@@ -47,7 +40,7 @@ module Sinatra
47
40
  title << " " unless index == word_arr.length-1
48
41
  end
49
42
  end
50
- query = HTTParty.get(URI.escape("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/search?q=#{title}"))
43
+ query = HTTParty.get(URI.escape("#{search_endpoint}?q=#{title}"))
51
44
  if query["movies"] && query["movies"].count == 1
52
45
  movie = query["movies"].first
53
46
  elsif query["movies"] && query["movies"].count > 1
@@ -59,7 +52,7 @@ module Sinatra
59
52
  response = AlexaObjects::Response.new
60
53
 
61
54
  if [movie].flatten(1).count == 1 && movie != false
62
- add_query = HTTParty.get(URI.escape("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/movie.add?title=#{movie["titles"].first}&identifier#{movie["imdb"]}"))
55
+ add_query = HTTParty.get(URI.escape("#{add_endpoint}?title=#{movie["titles"].first}&identifier#{movie["imdb"]}"))
63
56
  if add_query["success"] = true
64
57
  response.end_session = true
65
58
  response.spoken_response = "okay, downloading #{movie["titles"].first}"
@@ -84,7 +77,7 @@ module Sinatra
84
77
  ordinal = Chronic::Numerizer.numerize(@echo_request.slots["listvalue"]).split(' ').last
85
78
  number = ordinal[0]
86
79
  movie = @@movies[number.to_i+1]
87
- query = HTTParty.get(URI.escape("http://highasfuck.science/movies/api/550dfd233ffe453096c39293f4e38121/movie.add?title=#{movie["titles"].first}&identifier#{movie["imdb"]}"))
80
+ query = HTTParty.get(URI.escape("#{add_endpoint}?title=#{movie["titles"].first}&identifier#{movie["imdb"]}"))
88
81
  response = AlexaObjects::Response.new
89
82
  if movie != false && query["success"] = true
90
83
  response.end_session = true
@@ -0,0 +1,7 @@
1
+ module Sinatra
2
+ module Couchpotato
3
+ def self.custom_slots
4
+ File.read(File.expand_path('../../../skills_config/custom_slots.txt', __FILE__))
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Sinatra
2
+ module Couchpotato
3
+ def self.intent_schema
4
+ File.read(File.expand_path('../../../skills_config/intent_schema.txt', __FILE__))
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Sinatra
2
+ module Couchpotato
3
+ def self.sample_utterances
4
+ File.read(File.expand_path('../../../skills_config/sample_utterances.txt', __FILE__))
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module Couchpotato
3
- VERSION = "1.0.10"
3
+ VERSION = "1.0.11"
4
4
  end
5
5
  end
@@ -0,0 +1 @@
1
+ TEST
@@ -0,0 +1,22 @@
1
+ {
2
+ "intents": [
3
+ {
4
+ "intent": "ControlCouchpotato",
5
+ "slots": [
6
+ {
7
+ "name": "Movie",
8
+ "type": "AMAZON.LITERAL"
9
+ }
10
+ ]
11
+ },
12
+ {
13
+ "intent": "RespondCouchpotato",
14
+ "slots": [
15
+ {
16
+ "name": "ListValue",
17
+ "type": "AMAZON.literal"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,68 @@
1
+ ControlCouchpotato add {Movie|Movie}
2
+ ControlCouchpotato add {Moive Movie|Movie}
3
+ ControlCouchpotato add {Moive Movie Movie|Movie}
4
+ ControlCouchpotato add {Moive Movie Movie Movie|Movie}
5
+ ControlCouchpotato add {Moive Movie Movie Movie Movie|Movie}
6
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie|Movie}
7
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie|Movie}
8
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie Movie|Movie}
9
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
10
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
11
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
12
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
13
+ ControlCouchpotato add {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
14
+ ControlCouchpotato add the movie {Movie|Movie}
15
+ ControlCouchpotato add the movie {Moive Movie|Movie}
16
+ ControlCouchpotato add the movie {Moive Movie Movie|Movie}
17
+ ControlCouchpotato add the movie {Moive Movie Movie Movie|Movie}
18
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie|Movie}
19
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie|Movie}
20
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie|Movie}
21
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie Movie|Movie}
22
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
23
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
24
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
25
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
26
+ ControlCouchpotato add the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
27
+
28
+ ControlCouchpotato find {Movie|Movie}
29
+ ControlCouchpotato find {Moive Movie|Movie}
30
+ ControlCouchpotato find {Moive Movie Movie|Movie}
31
+ ControlCouchpotato find {Moive Movie Movie Movie|Movie}
32
+ ControlCouchpotato find {Moive Movie Movie Movie Movie|Movie}
33
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie|Movie}
34
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie|Movie}
35
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie Movie|Movie}
36
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
37
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
38
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
39
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
40
+ ControlCouchpotato find {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
41
+ ControlCouchpotato find the movie {Movie|Movie}
42
+ ControlCouchpotato find the movie {Moive Movie|Movie}
43
+ ControlCouchpotato find the movie {Moive Movie Movie|Movie}
44
+ ControlCouchpotato find the movie {Moive Movie Movie Movie|Movie}
45
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie|Movie}
46
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie|Movie}
47
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie|Movie}
48
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie Movie|Movie}
49
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
50
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
51
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
52
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
53
+ ControlCouchpotato find the movie {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
54
+ ControlCouchpotato find the {Movie|Movie}
55
+ ControlCouchpotato find the {Moive Movie|Movie}
56
+ ControlCouchpotato find the {Moive Movie Movie|Movie}
57
+ ControlCouchpotato find the {Moive Movie Movie Movie|Movie}
58
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie|Movie}
59
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie|Movie}
60
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie|Movie}
61
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie Movie|Movie}
62
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
63
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
64
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
65
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
66
+ ControlCouchpotato find the {Moive Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie Movie|Movie}
67
+
68
+ RespondCouchpotato download {the first|ListValue}
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.0.10
4
+ version: 1.0.11
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-02-12 00:00:00.000000000 Z
11
+ date: 2016-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -185,14 +185,21 @@ executables: []
185
185
  extensions: []
186
186
  extra_rdoc_files: []
187
187
  files:
188
+ - ".DS_Store"
188
189
  - ".gitignore"
189
190
  - Gemfile
190
191
  - Guardfile
191
192
  - Rakefile
192
193
  - alexa_couchpotato.gemspec
193
194
  - lib/alexa_couchpotato.rb
195
+ - lib/alexa_couchpotato/custom_slots.rb
196
+ - lib/alexa_couchpotato/intent_schema.rb
197
+ - lib/alexa_couchpotato/sample_utterances.rb
194
198
  - lib/alexa_couchpotato/version.rb
195
199
  - pkg/alexa_couchpotato-1.0.0.gem
200
+ - skills_config/custom_slots.txt
201
+ - skills_config/intent_schema.txt
202
+ - skills_config/sample_utterances.txt
196
203
  homepage: http://github.com/kylegrantlucas/alexa_couchpotato
197
204
  licenses:
198
205
  - MIT
@@ -201,6 +208,7 @@ post_install_message:
201
208
  rdoc_options: []
202
209
  require_paths:
203
210
  - lib
211
+ - skills_config
204
212
  required_ruby_version: !ruby/object:Gem::Requirement
205
213
  requirements:
206
214
  - - ">="
@@ -213,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
221
  version: '0'
214
222
  requirements: []
215
223
  rubyforge_project:
216
- rubygems_version: 2.2.2
224
+ rubygems_version: 2.4.8
217
225
  signing_key:
218
226
  specification_version: 4
219
227
  summary: A sinatra middleware for alexa couhpotato actions.