lita-wotd 1.0.0 → 1.1.0
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/wotd.rb +12 -5
- data/lita-wotd.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86f89aaa8ec02de298cd24271bb12c5dff1d8beb
|
4
|
+
data.tar.gz: 0ca747ee4466e52dc341c9cf52fb0cc980796d70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc7a83ac94b2359655c7c5b8fbefaef1118de2f97dca33c87c571e5a61daeca9ef4b29b37fd2ca5188486d2ecf69073a89abc63cff50501e3a7781d957e98d02
|
7
|
+
data.tar.gz: da46c00f1a013e5fae01f66a414499816a3d045f0072d13ff89feb8dc9e801fc79d4d9554b996b801cc79b61c7d500278cca1d2a8e1378371e65c28ee1183c85
|
data/lib/lita/handlers/wotd.rb
CHANGED
@@ -5,6 +5,8 @@ require 'rexml/document'
|
|
5
5
|
module Lita
|
6
6
|
module Handlers
|
7
7
|
class Wotd < Handler
|
8
|
+
WOTD_URL = 'https://wordsmith.org/awad/rss1.xml'.freeze
|
9
|
+
|
8
10
|
route(/wotd/, :wotd, command: true, help: {
|
9
11
|
'wotd' => 'returns the word of the day from dictionary.com'
|
10
12
|
})
|
@@ -14,18 +16,23 @@ module Lita
|
|
14
16
|
end
|
15
17
|
|
16
18
|
private
|
19
|
+
|
17
20
|
def the_word
|
18
|
-
"#{extract_the_word} -
|
21
|
+
"#{extract_the_word} - wordsmith.org"
|
19
22
|
end
|
20
23
|
|
21
24
|
def extract_the_word
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
title = doc.get_elements('//title').last.get_text
|
26
|
+
description = doc.get_elements('//description').last.get_text
|
27
|
+
"#{title} => #{description}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def doc
|
31
|
+
@doc ||= REXML::Document.new(api_call.body)
|
25
32
|
end
|
26
33
|
|
27
34
|
def uri
|
28
|
-
URI.parse
|
35
|
+
URI.parse WOTD_URL
|
29
36
|
end
|
30
37
|
|
31
38
|
def api_call
|
data/lita-wotd.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-wotd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maxbeizer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
137
|
+
rubygems_version: 2.6.13
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: A lita bot to get the word of the day from dictionary.com
|