t 3.1.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.md +1 -1
- data/README.md +8 -9
- data/bin/t +21 -21
- data/lib/t/cli.rb +470 -463
- data/lib/t/collectable.rb +9 -8
- 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 +51 -51
- data/lib/t/printable.rb +69 -65
- data/lib/t/rcfile.rb +18 -17
- data/lib/t/requestable.rb +3 -2
- data/lib/t/search.rb +82 -82
- data/lib/t/set.rb +21 -21
- data/lib/t/stream.rb +67 -60
- data/lib/t/utils.rb +25 -25
- data/lib/t/version.rb +2 -2
- data/lib/t.rb +2 -2
- data/t.gemspec +22 -21
- metadata +29 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f132b268c436dcf3e1107b9747e8dd3f506f1883970c27b152cd1b6b3239e217
|
4
|
+
data.tar.gz: 3c267e930330b7cd736e444b34b508e89e4eedf38124d69b13c15a79e38f49a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0308f8a1a345f776f6226cd04d7ac6dce6d7532f63a1182c8fba908babf156ce7a4a0a2ee6674db01ddad1651dce06335d0f84a13388d6fb9851f6fd6d123be7'
|
7
|
+
data.tar.gz: 9804666bcde9a82bc9c8350c3f39b297c6c2c5c6629da53b8ebd96eaad80d46a6477779f8a15a467a773a9ccbcedf06fdb6d124e2b858f1307030c6c88d7405b
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -5,13 +5,11 @@
|
|
5
5
|
[![Gem Version](https://img.shields.io/gem/v/t.svg)][gem]
|
6
6
|
[![Build Status](https://img.shields.io/travis/sferik/t.svg)][travis]
|
7
7
|
[![Dependency Status](https://img.shields.io/gemnasium/sferik/t.svg)][gemnasium]
|
8
|
-
[![Coverage Status](https://img.shields.io/coveralls/sferik/t.svg)][coveralls]
|
9
8
|
[![tip for next commit](https://tip4commit.com/projects/102.svg)](https://tip4commit.com/github/sferik/t)
|
10
9
|
|
11
10
|
[gem]: https://rubygems.org/gems/t
|
12
11
|
[travis]: https://travis-ci.org/sferik/t
|
13
12
|
[gemnasium]: https://gemnasium.com/sferik/t
|
14
|
-
[coveralls]: https://coveralls.io/r/sferik/t
|
15
13
|
|
16
14
|
#### A command-line power tool for Twitter.
|
17
15
|
The CLI takes syntactic cues from the [Twitter SMS commands][sms], but it
|
@@ -31,6 +29,7 @@ If the output looks something like this, you're in good shape:
|
|
31
29
|
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
|
32
30
|
|
33
31
|
If the output looks more like this, you need to [install Ruby][ruby]:
|
32
|
+
|
34
33
|
[ruby]: https://www.ruby-lang.org/en/downloads/
|
35
34
|
|
36
35
|
ruby: command not found
|
@@ -45,7 +44,8 @@ or for Red Hat-based distros like Fedora and CentOS, type:
|
|
45
44
|
|
46
45
|
(if necessary, adapt for your package manager)
|
47
46
|
|
48
|
-
**On Windows**, you can install Ruby with [RubyInstaller][].
|
47
|
+
**On Windows**, you can install Ruby with [RubyInstaller][rubyinstaller].
|
48
|
+
|
49
49
|
[rubyinstaller]: http://rubyinstaller.org/downloads/
|
50
50
|
|
51
51
|
## Installation
|
@@ -199,7 +199,7 @@ example, here's how to send a user a direct message only if they already follow
|
|
199
199
|
|
200
200
|
#### Search Tweets in your home timeline that match a specified query
|
201
201
|
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.
|
202
|
+
**Note**: In Twitter API parlance, your “home timeline” is your “Newsfeed” whereas your “user timeline” are the tweets tweeted (and retweeted) by you.
|
203
203
|
|
204
204
|
#### Search Tweets in a specified user’s timeline
|
205
205
|
t search timeline @sferik "query"
|
@@ -288,10 +288,9 @@ the original code.
|
|
288
288
|
This library aims to support and is [tested against][travis] the following Ruby
|
289
289
|
implementations:
|
290
290
|
|
291
|
-
* Ruby
|
292
|
-
* Ruby 2
|
293
|
-
* Ruby
|
294
|
-
* Ruby 2.3
|
291
|
+
* Ruby 3.1
|
292
|
+
* Ruby 3.2
|
293
|
+
* Ruby 3.3
|
295
294
|
|
296
295
|
If something doesn't work on one of these Ruby versions, it's a bug.
|
297
296
|
|
@@ -312,7 +311,7 @@ If you are running t on a remote computer you can use the flag --display-uri dur
|
|
312
311
|
t authorize --display-uri
|
313
312
|
|
314
313
|
## Copyright
|
315
|
-
Copyright (c) 2011-
|
314
|
+
Copyright (c) 2011-2024 Erik Berlin. See [LICENSE][] for details.
|
316
315
|
Application icon by [@nvk][nvk].
|
317
316
|
|
318
317
|
[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
|