lita-recipe 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/recipe.rb +4 -4
- data/lita-recipe.gemspec +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: 83615fb8bc4ae8b189d9a7b717647b1c92041967
|
4
|
+
data.tar.gz: 24125bb1656f2180e7991c49570d99ce7fc963bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d0cc1d7da153e5aa342abad54cda8810dda9708bf1e6c9f851e5e0127054111529328ccc0a4b7e093731a241060f527a362aafeb01cab2238e31a42457a3443
|
7
|
+
data.tar.gz: c7e2b0d8134f71b8544f76fdaeb4770de33d60e29fe5699a0b4574bc846452e29b5e2a440400c77463f33c0b25136d0e4f7b3bbdb0408d3be77ee4d3c9eb94bd
|
data/lib/lita/handlers/recipe.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'lita'
|
2
2
|
require 'net/http'
|
3
3
|
require 'uri'
|
4
|
-
require '
|
4
|
+
require 'multi_json'
|
5
5
|
|
6
6
|
module Lita
|
7
7
|
module Handlers
|
@@ -11,13 +11,13 @@ module Lita
|
|
11
11
|
|
12
12
|
def recipe(response)
|
13
13
|
res = Net::HTTP.get_response(URI("http://food2fork.com/api/search?key=#{api_key}&sort=t"))
|
14
|
-
|
15
|
-
|
14
|
+
top_list = MultiJson.load(res.body)
|
15
|
+
response.reply(top_list["recipes"].shuffle.first["f2f_url"])
|
16
16
|
end
|
17
17
|
private
|
18
18
|
|
19
19
|
def api_key
|
20
|
-
Lita.config.
|
20
|
+
Lita.config.handlers.recipe.api_key
|
21
21
|
end
|
22
22
|
|
23
23
|
Lita.register_handler(Recipe)
|
data/lita-recipe.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-recipe"
|
3
|
-
spec.version = "0.0.
|
3
|
+
spec.version = "0.0.3"
|
4
4
|
spec.authors = ["Daniel Nunez"]
|
5
5
|
spec.email = ["reachdanielnunez@gmail.com"]
|
6
6
|
spec.description = %q{A lita handler that will display a random trending recipe}
|