twittbot 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/twittbot.rb +1 -0
- data/lib/twittbot/bot.rb +20 -12
- data/lib/twittbot/defaults.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6aab010a8bb449d80ddb799d24cf777dd8b0ac0f
|
4
|
+
data.tar.gz: ee4b86283e0cc8d1dcbb9addb4697664cf11c224
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a44776d52015048faa823ed0b6f920adfa60de17b7b7a61fe6283edb56ba25383c2d4db9cae3e83bcb0585e8a34cb351568ae8f55d30f1dbb6042be0d597d5c5
|
7
|
+
data.tar.gz: 82025f7e7675bdd3373033ffc571225a848ff16c614bfcc78d262d85b39ecef03be17c262ebc84a371500cdcdfe23ba3d5e7b9ed5550c70c6ce968b95b715558
|
data/lib/twittbot.rb
CHANGED
data/lib/twittbot/bot.rb
CHANGED
@@ -71,24 +71,32 @@ module Twittbot
|
|
71
71
|
init_clients
|
72
72
|
|
73
73
|
@userstream_thread ||= Thread.new do
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
74
|
+
loop do
|
75
|
+
begin
|
76
|
+
puts "connected to user stream"
|
77
|
+
@streamer.user do |obj|
|
78
|
+
handle_stream_object obj, :user
|
79
|
+
end
|
80
|
+
rescue => e
|
81
|
+
puts "lost user stream connection: " + e.message
|
78
82
|
end
|
79
|
-
|
80
|
-
|
83
|
+
puts "reconnecting in #{Twittbot::RECONNECT_WAIT_TIME} seconds..."
|
84
|
+
sleep Twittbot::RECONNECT_WAIT_TIME
|
81
85
|
end
|
82
86
|
end
|
83
87
|
|
84
88
|
@tweetstream_thread ||= Thread.new do
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
+
loop do
|
90
|
+
begin
|
91
|
+
puts "connected to tweet stream"
|
92
|
+
@streamer.filter track: $bot[:config][:track].join(",") do |obj|
|
93
|
+
handle_stream_object obj, :filter
|
94
|
+
end
|
95
|
+
rescue
|
96
|
+
puts "lost tweet stream connection: " + e.message
|
89
97
|
end
|
90
|
-
|
91
|
-
|
98
|
+
puts "reconnecting in #{Twittbot::RECONNECT_WAIT_TIME} seconds..."
|
99
|
+
sleep Twittbot::RECONNECT_WAIT_TIME
|
92
100
|
end
|
93
101
|
end
|
94
102
|
|
data/lib/twittbot/defaults.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Twittbot
|
2
2
|
# The version of Twittbot.
|
3
|
-
VERSION = "0.1.
|
3
|
+
VERSION = "0.1.2"
|
4
4
|
|
5
5
|
CONSUMER_KEY = 'FYRuQcDbPAXAyVjuPZMuw' # :nodoc:
|
6
6
|
CONSUMER_SECRET = 'KiLCYTftPdxNebl5DNcj7Ey2Y8YVZu7hfqiFRYkcg' # :nodoc:
|
@@ -20,4 +20,7 @@ module Twittbot
|
|
20
20
|
admins: [],
|
21
21
|
dm_command_prefix: '!'
|
22
22
|
}
|
23
|
+
|
24
|
+
# How many seconds should be waited until the bot reconnects
|
25
|
+
RECONNECT_WAIT_TIME = 5
|
23
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twittbot
|
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
|
- nilsding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|