alltweets 1.1.1 → 1.1.2
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 +4 -4
- data/README.md +1 -1
- data/lib/alltweets/cli.rb +29 -8
- data/lib/alltweets/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbc242aaa738c9ff355f6bf278eb9feb43bdc326
|
|
4
|
+
data.tar.gz: 4ff73009c35018981159be625d0002ac272356ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 58ccb2e1643a564fef9acb0a8831c5a125e33a2739cca377e8c3a591d9a494050c66ba1054f212aad6601b28a06b271584c80e14ee968a54d4bdf324de5ded33
|
|
7
|
+
data.tar.gz: e687977c6f16cebb8aeba9443f53f732ebfc0dbe88edf6d0d3a57c8405c811c2ef309dc584cd73ea335f3055be72a3fd7d99e17f42da8665585a38631b29abd4
|
data/README.md
CHANGED
data/lib/alltweets/cli.rb
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
require "colorize"
|
|
2
2
|
require "json"
|
|
3
|
-
require "
|
|
3
|
+
require "optparse"
|
|
4
|
+
require "yaml"
|
|
5
|
+
require "alltweets/fetcher"
|
|
6
|
+
require "alltweets/settings"
|
|
7
|
+
require "alltweets/version"
|
|
4
8
|
|
|
5
9
|
module AllTweets
|
|
6
10
|
class CLI
|
|
@@ -18,9 +22,9 @@ module AllTweets
|
|
|
18
22
|
|
|
19
23
|
def run
|
|
20
24
|
warn "Downloading @#{@screen_name}'s all tweets"
|
|
21
|
-
result = @fetcher.fetch_all_tweets(@screen_name, include_retweets: @opts[
|
|
25
|
+
result = @fetcher.fetch_all_tweets(@screen_name, include_retweets: @opts["retweets"]).map(&:to_h)
|
|
22
26
|
|
|
23
|
-
if @opts[
|
|
27
|
+
if @opts["yaml"]
|
|
24
28
|
dump_data = YAML.dump(result)
|
|
25
29
|
else
|
|
26
30
|
dump_data = JSON.dump(result)
|
|
@@ -34,14 +38,31 @@ module AllTweets
|
|
|
34
38
|
|
|
35
39
|
private
|
|
36
40
|
def parse_args
|
|
37
|
-
opts =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
opts = ARGV.getopts("", "retweets", "yaml", "help", "version")
|
|
42
|
+
|
|
43
|
+
if opts["help"]
|
|
44
|
+
puts <<EOS
|
|
45
|
+
alltweets #{VERSION}
|
|
46
|
+
|
|
47
|
+
Usage:
|
|
48
|
+
alltweets [options] SCREEN_NAME
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
-r, --retweets Include retweets
|
|
52
|
+
-y, --yaml Use YAML instead of JSON
|
|
53
|
+
-v, --version Print version and exit
|
|
54
|
+
-h, --help Show this message
|
|
55
|
+
EOS
|
|
56
|
+
exit
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
if opts["version"]
|
|
60
|
+
puts "alltweets #{VERSION}"
|
|
61
|
+
exit
|
|
41
62
|
end
|
|
42
63
|
|
|
43
64
|
unless ARGV.size == 1
|
|
44
|
-
warn "usage: alltweets [options]
|
|
65
|
+
warn "usage: alltweets [options] SCREEN_NAME"
|
|
45
66
|
exit 1
|
|
46
67
|
end
|
|
47
68
|
|
data/lib/alltweets/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: alltweets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tatsuya Otsuka
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colorize
|
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
151
151
|
version: '0'
|
|
152
152
|
requirements: []
|
|
153
153
|
rubyforge_project:
|
|
154
|
-
rubygems_version: 2.6.
|
|
154
|
+
rubygems_version: 2.6.8
|
|
155
155
|
signing_key:
|
|
156
156
|
specification_version: 4
|
|
157
157
|
summary: Downloads someone's all tweets.
|