twitter2jabber 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/twitter2jabber/version.rb +2 -2
- data/lib/twitter2jabber.rb +10 -9
- metadata +5 -5
data/README
CHANGED
data/lib/twitter2jabber.rb
CHANGED
@@ -159,18 +159,19 @@ class Twitter2Jabber
|
|
159
159
|
def twitter_connect(options = @twitter_options)
|
160
160
|
@twitter_options = options
|
161
161
|
|
162
|
-
|
163
|
-
|
162
|
+
@twitter = Twitter.client(
|
163
|
+
:consumer_key => options[:consumer_token],
|
164
|
+
:consumer_secret => options[:consumer_secret],
|
165
|
+
:oauth_token => options[:access_token],
|
166
|
+
:oauth_token_secret => options[:access_secret]
|
167
|
+
)
|
164
168
|
|
165
|
-
@twitter = Twitter::Base.new(auth)
|
166
|
-
|
167
|
-
# verify credentials
|
168
169
|
@twitter.verify_credentials
|
169
170
|
|
170
171
|
logt 'connected'
|
171
172
|
|
172
173
|
@twitter
|
173
|
-
rescue Twitter::
|
174
|
+
rescue Twitter::Error => err
|
174
175
|
raise "Can't connect to Twitter with ID '#{options[:consumer_token]}': #{err}"
|
175
176
|
end
|
176
177
|
|
@@ -196,7 +197,7 @@ class Twitter2Jabber
|
|
196
197
|
tweets.sort_by { |tweet|
|
197
198
|
tweet.created_at = Time.parse(tweet.created_at)
|
198
199
|
}
|
199
|
-
rescue Twitter::
|
200
|
+
rescue Twitter::Error, Twitter::ServiceUnavailable, Timeout::Error
|
200
201
|
[]
|
201
202
|
rescue => err
|
202
203
|
warn "#{err} (#{err.class})"
|
@@ -322,7 +323,7 @@ le[n[gth]] STATUS -- Determine length
|
|
322
323
|
id, colon = $1, $2
|
323
324
|
|
324
325
|
tweet = twitter.status(id)
|
325
|
-
raise Twitter::NotFound unless tweet.is_a?(Hashie::
|
326
|
+
raise Twitter::NotFound unless tweet.is_a?(Hashie::Rash)
|
326
327
|
|
327
328
|
if body.empty?
|
328
329
|
options[:id] = id
|
@@ -334,7 +335,7 @@ le[n[gth]] STATUS -- Determine length
|
|
334
335
|
id, colon = $1, $2
|
335
336
|
|
336
337
|
tweet = twitter.status(id)
|
337
|
-
raise Twitter::NotFound unless tweet.is_a?(Hashie::
|
338
|
+
raise Twitter::NotFound unless tweet.is_a?(Hashie::Rash)
|
338
339
|
|
339
340
|
body.insert(0, ' ') unless body.empty?
|
340
341
|
body.insert(0, "@#{tweet.user.screen_name}#{colon}")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter2jabber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jens Wille
|
@@ -149,7 +149,7 @@ rdoc_options:
|
|
149
149
|
- UTF-8
|
150
150
|
- --all
|
151
151
|
- --title
|
152
|
-
- twitter2jabber Application documentation (v0.
|
152
|
+
- twitter2jabber Application documentation (v0.4.0)
|
153
153
|
require_paths:
|
154
154
|
- lib
|
155
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|