twat 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twat.rb +1 -1
- data/lib/twat/actions.rb +7 -2
- data/lib/twat/argparse.rb +4 -0
- metadata +6 -6
data/lib/twat.rb
CHANGED
data/lib/twat/actions.rb
CHANGED
@@ -54,6 +54,12 @@ module Twat
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
+
def follow_user
|
58
|
+
twitter_auth
|
59
|
+
|
60
|
+
Twitter.follow(opts[:user])
|
61
|
+
end
|
62
|
+
|
57
63
|
def setoption
|
58
64
|
k, v = opts[:optval].split("=")
|
59
65
|
raise RequiresOptVal unless v
|
@@ -105,9 +111,8 @@ module Twat
|
|
105
111
|
sleep config.polling_interval
|
106
112
|
tweets = Twitter.home_timeline(:since_id => last_id)
|
107
113
|
failcount = 0
|
108
|
-
rescue Interrupt
|
109
|
-
break
|
110
114
|
rescue Twitter::ServiceUnavailable
|
115
|
+
rescue Interrupt
|
111
116
|
if failcount > 2
|
112
117
|
puts "3 consecutive failures, giving up"
|
113
118
|
else
|
data/lib/twat/argparse.rb
CHANGED
@@ -25,6 +25,10 @@ module Twat
|
|
25
25
|
options[:account] = acct.to_sym
|
26
26
|
options[:action] = :add
|
27
27
|
end #}}}
|
28
|
+
opts.on('--follow-user USER', 'Follow USER on twitter') do |user| #{{{ --follow-user USER
|
29
|
+
options[:action] = :follow_user
|
30
|
+
options[:user] = user
|
31
|
+
end #}}}
|
28
32
|
opts.on('--endpoint ENDPOINT', 'Specify a different endpoint for use with --add') do |endpoint| #{{{ --add ACCOUNT
|
29
33
|
options[:endpoint] = endpoint.to_sym
|
30
34
|
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.
|
4
|
+
version: 0.5.2
|
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:
|
12
|
+
date: 2012-01-25 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: twitter
|
16
|
-
requirement: &
|
16
|
+
requirement: &26440540 !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: *
|
24
|
+
version_requirements: *26440540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: oauth
|
27
|
-
requirement: &
|
27
|
+
requirement: &26439880 !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: *
|
35
|
+
version_requirements: *26439880
|
36
36
|
description: Command line tool for tweeting and whatnot
|
37
37
|
email:
|
38
38
|
- richo@psych0tik.net
|