lita-apod 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e254eec031cb92c7f8e96e6c640a8479d903c23e
4
- data.tar.gz: 368f646cb334d4503faf711ad7a7ff9c0d917f8b
3
+ metadata.gz: 853da9a4e5b9bc69a1aae46bc0870ac0cd124d59
4
+ data.tar.gz: 6ae1b77721ebaf077126b77da269042d8f4ab12f
5
5
  SHA512:
6
- metadata.gz: 7b021cb1242d84787bc7c2c161a46c5443ae9f6d35dc3c422df7df6001c0d9b19b4cadad83bdaca36bdd28f5edc5da32e2ef5815f3f03b9b8b1cb56b5ffab041
7
- data.tar.gz: 8bdefd9b14e2d067f316c46bb5617f9777b7f58d084885b6429e8b2a5f0f8e4d1c55e419efd627ca333f57feff53273c72cd58f2405c65fff48028f62b428bf0
6
+ metadata.gz: 92fab9582d42e42c8b9d2f38887a03c2502b3825a16fccad14538c6b2c3d423ecd85c305a5eda1444526a8f91dfbb9f2f5edf9f28c3a88c27778334582227b2a
7
+ data.tar.gz: c7ca11907516053b5bab0d00743f4fc6648f5352cd4da2c06096f8f6af6910e752ba6cff544852057846a8248faf9ed442ce6f3e71daa38f6a759e8d8e7a54b7
data/README.md CHANGED
@@ -12,7 +12,13 @@ gem "lita-apod"
12
12
 
13
13
  ## Configuration
14
14
 
15
- No configuration necessary! NASA gives their API away for free!!
15
+ ~~No configuration necessary! NASA gives their API away for free!!~~
16
+
17
+ Nasa limits their API calls using their free demo key. If you're going to use this for a pretty active bot, get a key from https://api.nasa.gov/api.html#authentication. Otherwise, 'DEMO_KEY' will work for the default key.
18
+
19
+ Put the below in your lita-config.rb file and have fun!
20
+
21
+ ```config.handlers.apod.apod_api_key = 'DEMO_KEY'```
16
22
 
17
23
  ## Usage
18
24
 
@@ -2,6 +2,8 @@ module Lita
2
2
  module Handlers
3
3
  class Apod < Handler
4
4
 
5
+ config :apod_api_key
6
+
5
7
  route(%r{^apod\?$}i, command: true, help: {
6
8
  "apod?" => "Gives you a RANDOM pretty picture! Pulled random from the NASA Picture of the Day. https://apod.nasa.gov/"
7
9
  }) do |response|
@@ -10,7 +12,7 @@ module Lita
10
12
 
11
13
  messageBody = ""
12
14
 
13
- res = http.get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=#{rando}")
15
+ res = http.get("https://api.nasa.gov/planetary/apod?api_key=#{config.apod_api_key}&date=#{rando}")
14
16
 
15
17
  object = MultiJson.load(res.body)
16
18
 
@@ -27,7 +29,7 @@ module Lita
27
29
 
28
30
  messageBody = ""
29
31
 
30
- res = http.get('https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY')
32
+ res = http.get("https://api.nasa.gov/planetary/apod?api_key=#{config.apod_api_key}")
31
33
 
32
34
  object = MultiJson.load(res.body)
33
35
 
data/lita-apod.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-apod"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.4.0"
4
4
  spec.authors = "John Celoria"
5
5
  spec.email = "jceloria@gmail.com"
6
6
  spec.description = "Pulls a picture using the NASA APOD (astronomy picture of the day) API endpoint"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-apod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Celoria
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-22 00:00:00.000000000 Z
11
+ date: 2018-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita