twitter2jabber 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to twitter2jabber version 0.4.0
5
+ This documentation refers to twitter2jabber version 0.5.0
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -3,7 +3,7 @@ class Twitter2Jabber
3
3
  module Version
4
4
 
5
5
  MAJOR = 0
6
- MINOR = 4
6
+ MINOR = 5
7
7
  TINY = 0
8
8
 
9
9
  class << self
@@ -159,7 +159,7 @@ class Twitter2Jabber
159
159
  def twitter_connect(options = @twitter_options)
160
160
  @twitter_options = options
161
161
 
162
- @twitter = Twitter.client(
162
+ @twitter = Twitter.new(
163
163
  :consumer_key => options[:consumer_token],
164
164
  :consumer_secret => options[:consumer_secret],
165
165
  :oauth_token => options[:access_token],
@@ -183,7 +183,7 @@ class Twitter2Jabber
183
183
  logj 'connected'
184
184
 
185
185
  @jabber
186
- rescue Jabber::JabberError => err
186
+ rescue Jabber::JabberError, Errno::ETIMEDOUT => err
187
187
  raise "Can't connect to Jabber with JID '#{options[:user]}': #{err}"
188
188
  end
189
189
 
@@ -197,7 +197,7 @@ class Twitter2Jabber
197
197
  tweets.sort_by { |tweet|
198
198
  tweet.created_at = Time.parse(tweet.created_at)
199
199
  }
200
- rescue Twitter::Error, Twitter::ServiceUnavailable, Timeout::Error
200
+ rescue Twitter::Error, Timeout::Error
201
201
  []
202
202
  rescue => err
203
203
  warn "#{err} (#{err.class})"
@@ -323,7 +323,7 @@ le[n[gth]] STATUS -- Determine length
323
323
  id, colon = $1, $2
324
324
 
325
325
  tweet = twitter.status(id)
326
- raise Twitter::NotFound unless tweet.is_a?(Hashie::Rash)
326
+ raise Twitter::NotFound unless tweet.is_a?(Hashie::Hash)
327
327
 
328
328
  if body.empty?
329
329
  options[:id] = id
@@ -335,7 +335,7 @@ le[n[gth]] STATUS -- Determine length
335
335
  id, colon = $1, $2
336
336
 
337
337
  tweet = twitter.status(id)
338
- raise Twitter::NotFound unless tweet.is_a?(Hashie::Rash)
338
+ raise Twitter::NotFound unless tweet.is_a?(Hashie::Hash)
339
339
 
340
340
  body.insert(0, ' ') unless body.empty?
341
341
  body.insert(0, "@#{tweet.user.screen_name}#{colon}")
@@ -357,7 +357,8 @@ le[n[gth]] STATUS -- Determine length
357
357
  end
358
358
 
359
359
  body.gsub!(/https?:\/\/\S+/) { |match|
360
- match.length < 30 ? match : ShortURL.shorten(match)
360
+ short = ShortURL.shorten(match, :tinyurl)
361
+ short && short.length < match.length ? short : match
361
362
  }
362
363
 
363
364
  return body unless execute
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: 15
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 4
8
+ - 5
9
9
  - 0
10
- version: 0.4.0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-03 00:00:00 Z
18
+ date: 2011-07-29 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: twitter
@@ -142,14 +142,14 @@ licenses: []
142
142
 
143
143
  post_install_message:
144
144
  rdoc_options:
145
- - --line-numbers
145
+ - --all
146
146
  - --main
147
147
  - README
148
148
  - --charset
149
149
  - UTF-8
150
- - --all
151
150
  - --title
152
- - twitter2jabber Application documentation (v0.4.0)
151
+ - twitter2jabber Application documentation (v0.5.0)
152
+ - --line-numbers
153
153
  require_paths:
154
154
  - lib
155
155
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  requirements: []
174
174
 
175
175
  rubyforge_project: twitter2jabber
176
- rubygems_version: 1.7.2
176
+ rubygems_version: 1.8.6
177
177
  signing_key:
178
178
  specification_version: 3
179
179
  summary: Twitter-to-Jabber gateway.