lita-onewheel-twitter-photo 0.0.2 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d236875712301bf4ce3919fa190f39801323c1a
|
4
|
+
data.tar.gz: 35daad89ea37cfb94308f6b1f8aabb4a57764407
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c261b5abaa24397fec3d831a917452db5b5c3bedc1fc7a91d7180307051e615c26505d66931133d68c8bcae1b114db06d1376297e1f95adc3ebbf10e7bcbae5f
|
7
|
+
data.tar.gz: 7f9428e2487c8f2ad429a142151a74757c76f5db4c45c48efe9343bd224d05b3aea918d60578b3221be33e28558ef9df31434abc7907d70d842c0c963887c10c
|
@@ -4,7 +4,7 @@ require 'rest-client'
|
|
4
4
|
module Lita
|
5
5
|
module Handlers
|
6
6
|
class OnewheelTwitterPhoto < Handler
|
7
|
-
route /(http.*twitter.com\/.*\/status\/\d+)/i, :
|
7
|
+
route /(http.*twitter.com\/.*\/status\/\d+)/i, :get_twitter_title
|
8
8
|
|
9
9
|
def get_twitter_photo(response)
|
10
10
|
uri = response.matches[0][0]
|
@@ -22,6 +22,15 @@ module Lita
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
def get_twitter_title(response)
|
26
|
+
uri = response.matches[0][0]
|
27
|
+
doc = RestClient.get uri
|
28
|
+
noko_doc = Nokogiri::HTML doc
|
29
|
+
title = noko_doc.xpath('//title').text.to_s
|
30
|
+
Lita.logger.debug title
|
31
|
+
response.reply title
|
32
|
+
end
|
33
|
+
|
25
34
|
Lita.register_handler(self)
|
26
35
|
end
|
27
36
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-onewheel-twitter-photo'
|
3
|
-
spec.version = '0.0
|
3
|
+
spec.version = '0.1.0'
|
4
4
|
spec.authors = ['Andrew Kreps']
|
5
5
|
spec.email = ['andrew.kreps@gmail.com']
|
6
6
|
spec.description = %q{Lita interface to post links to twitter photos.}
|
@@ -15,14 +15,14 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
17
|
spec.add_runtime_dependency 'lita', '~> 4'
|
18
|
-
spec.add_runtime_dependency 'rest-client', '~> 1
|
19
|
-
spec.add_runtime_dependency 'nokogiri', '~> 1
|
18
|
+
spec.add_runtime_dependency 'rest-client', '~> 1'
|
19
|
+
spec.add_runtime_dependency 'nokogiri', '~> 1'
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1'
|
22
22
|
# spec.add_development_dependency 'pry-byebug', '~> 3.1'
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
24
|
-
spec.add_development_dependency 'rack-test', '~> 0
|
25
|
-
spec.add_development_dependency 'rspec', '~> 3
|
26
|
-
spec.add_development_dependency 'simplecov', '~> 0
|
27
|
-
spec.add_development_dependency 'coveralls', '~> 0
|
23
|
+
spec.add_development_dependency 'rake', '~> 12'
|
24
|
+
spec.add_development_dependency 'rack-test', '~> 0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3'
|
26
|
+
spec.add_development_dependency 'simplecov', '~> 0'
|
27
|
+
spec.add_development_dependency 'coveralls', '~> 0'
|
28
28
|
end
|
@@ -6,9 +6,14 @@ def mock_fixture(fixture)
|
|
6
6
|
end
|
7
7
|
|
8
8
|
describe Lita::Handlers::OnewheelTwitterPhoto, lita_handler: true do
|
9
|
-
it 'puts the twitter photo on the response' do
|
9
|
+
# it 'puts the twitter photo on the response' do
|
10
|
+
# mock_fixture('sample')
|
11
|
+
# send_message ('https://twitter.com/th3fallen/status/689501399084855297')
|
12
|
+
# expect(replies.last).to eq('https://pbs.twimg.com/media/CZmsv0SWYAAaO1N.png')
|
13
|
+
# end
|
14
|
+
it 'gets text' do
|
10
15
|
mock_fixture('sample')
|
11
16
|
send_message ('https://twitter.com/th3fallen/status/689501399084855297')
|
12
|
-
expect(replies.last).to eq('https://
|
17
|
+
expect(replies.last).to eq('Gavin Joyce on Twitter: "It sounds crazy, but disabling npm\'s progress bar yields a 2x npm install speed improvement for me https://t.co/ChXxSepCBK"')
|
13
18
|
end
|
14
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-twitter-photo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -30,112 +30,112 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1
|
33
|
+
version: '1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1
|
40
|
+
version: '1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1
|
47
|
+
version: '1'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1
|
54
|
+
version: '1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1
|
61
|
+
version: '1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1
|
68
|
+
version: '1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '12'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '12'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rack-test
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '3
|
103
|
+
version: '3'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '3
|
110
|
+
version: '3'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0
|
117
|
+
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0
|
124
|
+
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: coveralls
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0
|
131
|
+
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0
|
138
|
+
version: '0'
|
139
139
|
description: Lita interface to post links to twitter photos.
|
140
140
|
email:
|
141
141
|
- andrew.kreps@gmail.com
|
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
178
|
rubyforge_project:
|
179
|
-
rubygems_version: 2.
|
179
|
+
rubygems_version: 2.6.11
|
180
180
|
signing_key:
|
181
181
|
specification_version: 4
|
182
182
|
summary: See above.
|