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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 358053305ed6ded66ba962ecb2b15283200e462d
4
- data.tar.gz: ef8a0bb1e58957fb1d0bb703d401999b1ca2b176
3
+ metadata.gz: e356f896238345fda48ecbfe32c1f7fbb5bb6290
4
+ data.tar.gz: 2ee856b691fd3912242722036ebba8531f035931
5
5
  SHA512:
6
- metadata.gz: ec6273f02e6c5820b25ffa238e9681c238c8e9442dbdd8087275daea6999f8d236ad21e42d5934891ba68dc46d51804c2e729097f8bffc545ef18b24220b67cb
7
- data.tar.gz: 1be50a16fa0587dee096976ada4c0dcebf8460543e073a29eef05626776ce367a2bfe25644b7ab8db99c3dfdc260d55955416540be4b342de726b0bbaa0ac632
6
+ metadata.gz: 9a0a8b27fb90dc481e3ef05bdb754ba3994e569dc4108b20a9df7a78d33a750f0ca6a0e63bafb8f2379d1e724c934889f696d72c4bfb5c26ef76d3922cbf05f4
7
+ data.tar.gz: 44fb299f131f9aeb66c549b06c5ac33fa90d0063f74d401f7eb25d08996e3240e6821fba79df7c7df9033c120b66e0345b1c0946daa8219736a55e53b6eeb26d
data/Gemfile CHANGED
@@ -4,7 +4,8 @@ gemspec
4
4
 
5
5
  gem 'chronic', '~> 0.10.0'
6
6
  gem 'chronic_duration', '~> 0'
7
- gem 'httparty', '~> 0.13.0'
7
+ gem 'curb'
8
+ gem 'oj'
8
9
  gem 'numbers_in_words', '~> 0.2.0'
9
10
  gem 'sinatra'
10
11
  gem 'alexa_objects'
@@ -0,0 +1,26 @@
1
+ # Alexa Couchpotato
2
+ [![Gem Version](https://badge.fury.io/rb/alexa_couchpotato.svg)](http://badge.fury.io/rb/alexa_couchpotato)
3
+ [![Code Climate](https://codeclimate.com/github/kylegrantlucas/alexa_couchpotato/badges/gpa.svg)](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
+
@@ -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 'httparty'
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'
@@ -1,6 +1,7 @@
1
1
  require 'json'
2
2
  require 'alexa_objects'
3
- require 'httparty'
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 = HTTParty.get(URI.escape("#{search_endpoint}?q=#{title}"))
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
- elsif movie == false
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
@@ -1,4 +1,4 @@
1
1
  module Couchpotato
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
4
4
 
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.0
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-02-17 00:00:00.000000000 Z
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: httparty
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.4.8
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