lita-pebbles 0.1.1 → 0.1.2
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/twitter_util.rb +31 -0
- data/lib/lita/pebbles/version.rb +1 -1
- data/lib/lita-pebbles.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e23053fb9a7d98532865a0b4144e3b4f6f8771c
|
4
|
+
data.tar.gz: 547100cdf395289238418f347cbc45ed73798a00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ffc75de8ef9352f6335cb0281918233b52fdc8886bf4cbe566fc8cf5b190d4149da9cf870e6754b64b1d4cf8175cda69c4112958cfb5a47120309f7b86d3e97
|
7
|
+
data.tar.gz: 0177bbfd8d41d6e4f48e7d82da164a07dd90330f5d79b077b61716ba251f5ec3f7d1021252aff81fd38ce71fa37af303c7a4e1917acd975768a5d963f8aef1a2
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Lita
|
2
|
+
module Handlers
|
3
|
+
class TwitterUtil < Handler
|
4
|
+
on :favorited, :on_favorited
|
5
|
+
on :unfavorited, :on_unfavorited
|
6
|
+
on :followed, :on_followed
|
7
|
+
|
8
|
+
def on_favorited(payload)
|
9
|
+
return if rand(2) == 0
|
10
|
+
# user = payload[:user]
|
11
|
+
# tweet = payload[:tweet]
|
12
|
+
target = Source.new(room: 1)
|
13
|
+
robot.send_message(target, ['ホクホク', 'ホクホク', 'hokuhoku', '!?', '!', 'フォクフォク'].sample)
|
14
|
+
end
|
15
|
+
|
16
|
+
def on_unfavorited(payload)
|
17
|
+
return if rand(2) == 0
|
18
|
+
# user = payload[:user]
|
19
|
+
# tweet = payload[:tweet]
|
20
|
+
target = Source.new(room: 1)
|
21
|
+
robot.send_message(target, ['!?', '!', 'ガーン', '!?', '( ‾᷄⌂‾᷅)', 'にゃーん'].sample)
|
22
|
+
end
|
23
|
+
|
24
|
+
def on_followed(payload)
|
25
|
+
user = payload[:user]
|
26
|
+
robot.join(user.id.to_i)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
Lita.register_handler(TwitterUtil)
|
30
|
+
end
|
31
|
+
end
|
data/lib/lita/pebbles/version.rb
CHANGED
data/lib/lita-pebbles.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-pebbles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fukayatsu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/lita/handlers/omikuji.rb
|
130
130
|
- lib/lita/handlers/pebbles.rb
|
131
131
|
- lib/lita/handlers/schedules.rb
|
132
|
+
- lib/lita/handlers/twitter_util.rb
|
132
133
|
- lib/lita/pebbles/version.rb
|
133
134
|
- lita-pebbles.gemspec
|
134
135
|
homepage: https://github.com/fukayatsu/lita-pebbles
|