twat 0.5.0 → 0.5.1

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/TODO CHANGED
@@ -15,7 +15,7 @@ tools will be written soon)
15
15
  (which carries with it warnings if it's too short.. which means a warn
16
16
  method.. which means abstracting it's output..)
17
17
 
18
- On the upside, it'll make unit testing similar.
18
+ On the upside, it'll make unit testing similar.
19
19
  (Add unit tests)
20
20
 
21
21
  Split config and options out into submodules
@@ -23,6 +23,11 @@ Split config and options out into submodules
23
23
  Allow upload of media files with the tweet via some kind of --attach
24
24
  (Has implications for other endpoints because we need that data from the user or to infer it somehow)
25
25
 
26
+ Mentions from non-followed accounts don't show up in -f
27
+
28
+ The handler to work out if a tweet is from you relies on the account
29
+ name being the same as the username, which is a dodgy assumption.
30
+
26
31
  PENDING
27
32
  =======
28
33
 
data/lib/twat.rb CHANGED
@@ -45,7 +45,7 @@ end
45
45
  module Twat
46
46
  VERSION_MAJOR = 0
47
47
  VERSION_MINOR = 5
48
- VERSION_PATCH = 0
48
+ VERSION_PATCH = 1
49
49
 
50
50
  VERSION = "#{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_PATCH}"
51
51
  class Twat
data/lib/twat/actions.rb CHANGED
@@ -107,6 +107,16 @@ module Twat
107
107
  failcount = 0
108
108
  rescue Interrupt
109
109
  break
110
+ rescue Twitter::ServiceUnavailable
111
+ if failcount > 2
112
+ puts "3 consecutive failures, giving up"
113
+ else
114
+ sleeptime = 60 * (failcount + 1)
115
+ print "(__-){".red
116
+ puts ": the fail whale has been rolled out, sleeping for #{sleeptime} seconds"
117
+ sleep sleeptime
118
+ failcount += 1
119
+ end
110
120
  rescue Errno::ECONNRESET
111
121
  rescue Errno::ETIMEDOUT
112
122
  if failcount > 2
@@ -157,7 +167,7 @@ module Twat
157
167
  end
158
168
 
159
169
  def deentitize(text)
160
- {"&lt;" => "<", "&gt;" => ">", "&amp;" => "&", "&quot;" => '"' }.each do |k,v|
170
+ {"&lt;" => "<", "&gt;" => ">", "&amp;" => "&", "&quot;" => '"', "&#39;" => '\'' }.each do |k,v|
161
171
  text.gsub!(k, v)
162
172
  end
163
173
  text
@@ -2,11 +2,14 @@ module Twat::Endpoints
2
2
  class Identica
3
3
 
4
4
  def initialize
5
- ::Twitter::Request.module_eval do
6
- alias :_request :request
7
- def request(method, path, params, options)
8
- path.gsub!(%r|^1/|, '')
9
- _request(method, path, params, options)
5
+ unless @@endpoint_set
6
+ @@endpoint_set = true
7
+ ::Twitter::Request.module_eval do
8
+ alias :_request :request
9
+ def request(method, path, params, options)
10
+ path.gsub!(%r|^1/|, '')
11
+ _request(method, path, params, options)
12
+ end
10
13
  end
11
14
  end
12
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-20 00:00:00.000000000Z
12
+ date: 2011-11-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: twitter
16
- requirement: &18544900 !ruby/object:Gem::Requirement
16
+ requirement: &10904540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *18544900
24
+ version_requirements: *10904540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth
27
- requirement: &18544400 !ruby/object:Gem::Requirement
27
+ requirement: &10904120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *18544400
35
+ version_requirements: *10904120
36
36
  description: Command line tool for tweeting and whatnot
37
37
  email:
38
38
  - richo@psych0tik.net
@@ -81,8 +81,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubyforge_project:
84
- rubygems_version: 1.8.6
84
+ rubygems_version: 1.8.10
85
85
  signing_key:
86
86
  specification_version: 3
87
87
  summary: Command line tool for tweeting and whatnot
88
88
  test_files: []
89
+ has_rdoc: