twitter2jabber 0.3.2 → 0.4.0

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.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to twitter2jabber version 0.3.2
5
+ This documentation refers to twitter2jabber version 0.4.0
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -3,8 +3,8 @@ class Twitter2Jabber
3
3
  module Version
4
4
 
5
5
  MAJOR = 0
6
- MINOR = 3
7
- TINY = 2
6
+ MINOR = 4
7
+ TINY = 0
8
8
 
9
9
  class << self
10
10
 
@@ -159,18 +159,19 @@ class Twitter2Jabber
159
159
  def twitter_connect(options = @twitter_options)
160
160
  @twitter_options = options
161
161
 
162
- auth = Twitter::OAuth.new(options[:consumer_token], options[:consumer_secret])
163
- auth.authorize_from_access(options[:access_token], options[:access_secret])
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::TwitterError => err
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::TwitterError, Twitter::Unavailable, Timeout::Error
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::Mash)
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::Mash)
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: 23
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
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.3.2)
152
+ - twitter2jabber Application documentation (v0.4.0)
153
153
  require_paths:
154
154
  - lib
155
155
  required_ruby_version: !ruby/object:Gem::Requirement