t 3.1.0 → 4.0.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.
- checksums.yaml +5 -5
- data/LICENSE.md +1 -1
- data/README.md +9 -7
- data/bin/t +21 -21
- data/lib/t/cli.rb +467 -458
- data/lib/t/collectable.rb +6 -4
- data/lib/t/core_ext/kernel.rb +3 -3
- data/lib/t/core_ext/string.rb +2 -2
- data/lib/t/delete.rb +44 -41
- data/lib/t/editor.rb +5 -5
- data/lib/t/identicon.rb +1 -1
- data/lib/t/list.rb +50 -50
- data/lib/t/printable.rb +68 -64
- data/lib/t/rcfile.rb +18 -17
- data/lib/t/requestable.rb +3 -2
- data/lib/t/search.rb +81 -81
- data/lib/t/set.rb +19 -19
- data/lib/t/stream.rb +67 -60
- data/lib/t/utils.rb +25 -25
- data/lib/t/version.rb +3 -3
- data/lib/t.rb +2 -2
- data/t.gemspec +22 -21
- metadata +23 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c05206c20098de8ab33a4e694a46b2b38a35617dff2abc951f89ef6780a69f29
|
4
|
+
data.tar.gz: 3072a72a478d93f3596a8a45c6b6be3cd6749c971fb5332d6e8badf9efe63faf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44c7e0859b2f3cca023f9f261110eb1c4796fed4144f33575e046ae6b00700c42adf231c83e42a0273f65cc1c4816a9c2ea2cec8c88b8c102270ceb0c4514b1f
|
7
|
+
data.tar.gz: ef0a67ecd302942a368f8cdcc49e3096455390423429cb23676b10e7ab7a6cad0a234e127f160854a9c9c355862e7468d7b64a5a92a7ce19c9afdaa990ca417d
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -31,6 +31,7 @@ If the output looks something like this, you're in good shape:
|
|
31
31
|
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
|
32
32
|
|
33
33
|
If the output looks more like this, you need to [install Ruby][ruby]:
|
34
|
+
|
34
35
|
[ruby]: https://www.ruby-lang.org/en/downloads/
|
35
36
|
|
36
37
|
ruby: command not found
|
@@ -45,7 +46,8 @@ or for Red Hat-based distros like Fedora and CentOS, type:
|
|
45
46
|
|
46
47
|
(if necessary, adapt for your package manager)
|
47
48
|
|
48
|
-
**On Windows**, you can install Ruby with [RubyInstaller][].
|
49
|
+
**On Windows**, you can install Ruby with [RubyInstaller][rubyinstaller].
|
50
|
+
|
49
51
|
[rubyinstaller]: http://rubyinstaller.org/downloads/
|
50
52
|
|
51
53
|
## Installation
|
@@ -199,7 +201,7 @@ example, here's how to send a user a direct message only if they already follow
|
|
199
201
|
|
200
202
|
#### Search Tweets in your home timeline that match a specified query
|
201
203
|
t search timeline "query"
|
202
|
-
**Note**: In Twitter API parlance, your “home timeline” is your “Newsfeed” whereas your “user timeline” are the tweets tweeted (and retweeted) by you.
|
204
|
+
**Note**: In Twitter API parlance, your “home timeline” is your “Newsfeed” whereas your “user timeline” are the tweets tweeted (and retweeted) by you.
|
203
205
|
|
204
206
|
#### Search Tweets in a specified user’s timeline
|
205
207
|
t search timeline @sferik "query"
|
@@ -288,10 +290,10 @@ the original code.
|
|
288
290
|
This library aims to support and is [tested against][travis] the following Ruby
|
289
291
|
implementations:
|
290
292
|
|
291
|
-
* Ruby 2.
|
292
|
-
* Ruby 2.
|
293
|
-
* Ruby 2.
|
294
|
-
* Ruby 2.
|
293
|
+
* Ruby 2.4
|
294
|
+
* Ruby 2.5
|
295
|
+
* Ruby 2.6
|
296
|
+
* Ruby 2.7
|
295
297
|
|
296
298
|
If something doesn't work on one of these Ruby versions, it's a bug.
|
297
299
|
|
@@ -312,7 +314,7 @@ If you are running t on a remote computer you can use the flag --display-uri dur
|
|
312
314
|
t authorize --display-uri
|
313
315
|
|
314
316
|
## Copyright
|
315
|
-
Copyright (c) 2011-
|
317
|
+
Copyright (c) 2011-2020 Erik Berlin. See [LICENSE][] for details.
|
316
318
|
Application icon by [@nvk][nvk].
|
317
319
|
|
318
320
|
[license]: https://github.com/sferik/t/blob/master/LICENSE.md
|
data/bin/t
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
# Trap interrupts to quit cleanly. See
|
4
4
|
# https://twitter.com/mitchellh/status/283014103189053442
|
5
|
-
Signal.trap(
|
5
|
+
Signal.trap("INT") { abort }
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
7
|
+
require "oauth"
|
8
|
+
require "t"
|
9
|
+
require "twitter"
|
10
10
|
|
11
11
|
# Output message to $stderr, prefixed with the program name
|
12
12
|
def pute(*args)
|
@@ -19,24 +19,24 @@ end
|
|
19
19
|
begin
|
20
20
|
T::CLI.start(ARGV)
|
21
21
|
rescue Interrupt
|
22
|
-
pute
|
22
|
+
pute "Quitting..."
|
23
23
|
rescue OAuth::Unauthorized
|
24
|
-
pute
|
25
|
-
rescue Twitter::Error::TooManyRequests =>
|
26
|
-
pute
|
27
|
-
rescue Twitter::Error::BadRequest =>
|
28
|
-
pute
|
29
|
-
rescue Twitter::Error::Forbidden, Twitter::Error::Unauthorized =>
|
30
|
-
if
|
31
|
-
|
32
|
-
|
33
|
-
require
|
34
|
-
Thor::Shell::Basic.new.ask
|
35
|
-
require
|
36
|
-
Launchy.open(
|
24
|
+
pute "Authorization failed"
|
25
|
+
rescue Twitter::Error::TooManyRequests => e
|
26
|
+
pute e.message, "The rate limit for this request will reset in #{e.rate_limit.reset_in} #{e.rate_limit.reset_in == 1 ? 'second' : 'seconds'}."
|
27
|
+
rescue Twitter::Error::BadRequest => e
|
28
|
+
pute e.message, "Run `t authorize` to authorize."
|
29
|
+
rescue Twitter::Error::Forbidden, Twitter::Error::Unauthorized => e
|
30
|
+
if e.message == "Error processing your OAuth request: Read-only application cannot POST" ||
|
31
|
+
e.message == "This application is not allowed to access or delete your direct messages"
|
32
|
+
warn(%q(Make sure to set your Twitter application's Access Level to "Read, Write and Access direct messages".))
|
33
|
+
require "thor"
|
34
|
+
Thor::Shell::Basic.new.ask "Press [Enter] to open the Twitter Developer site."
|
35
|
+
require "launchy"
|
36
|
+
Launchy.open("https://dev.twitter.com/apps") { |u, _, _| warn "Manually open #{u}" }
|
37
37
|
else
|
38
|
-
pute
|
38
|
+
pute e.message
|
39
39
|
end
|
40
|
-
rescue Twitter::Error =>
|
41
|
-
pute
|
40
|
+
rescue Twitter::Error => e
|
41
|
+
pute e.message
|
42
42
|
end
|