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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fa6ae80e53d25a10d041aac45490c23bf418d6e
4
- data.tar.gz: baa09c48fb274b01b4f2ca4867374996aa8d8a07
3
+ metadata.gz: 3e23053fb9a7d98532865a0b4144e3b4f6f8771c
4
+ data.tar.gz: 547100cdf395289238418f347cbc45ed73798a00
5
5
  SHA512:
6
- metadata.gz: 8a1985895c2c16e78d45c15109bef27ffb77036148a0c4731b9d9aef182a8e3967e4089cf4966177c7e5e1cb55ad3835f038f25c4509f1ec4b471bbdbc0522d8
7
- data.tar.gz: 6f8c4c96c82195b5a2ed035d2bf6a8f12e6e631dbf38e596aa431b0b79d43e02ff496b93ceb0c7d1a9bbcebc4cc2f6e11003c6226a9530b345563d6f992a3752
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
@@ -1,5 +1,5 @@
1
1
  module Lita
2
2
  module Pebbles
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
data/lib/lita-pebbles.rb CHANGED
@@ -8,3 +8,4 @@ require "lita/handlers/omikuji"
8
8
  require "lita/handlers/kansai"
9
9
  require "lita/handlers/misawa"
10
10
  require "lita/handlers/schedules"
11
+ require "lita/handlers/twitter_util"
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.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-06 00:00:00.000000000 Z
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