kuport 0.1.5 → 0.1.6
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/bin/kuport +21 -22
- data/lib/kuport/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 381e0567e391c27c10d8727f9bdb72ab3343b55ef68a9f1c32b443ad455ef351
|
|
4
|
+
data.tar.gz: 220dceb6da0066d018920725eedf7660e2a9655897588b9aede1bf2a35d5a86f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b127e36f8a6e0a5532b57c3706a5b9b0e5efce3fa03a5e6297e50bd5de8b087e41fe9a456b1291c7dcf0919e1e1ba9fd93cd162d20db133276f0593ebbe67fa
|
|
7
|
+
data.tar.gz: 9c6cf84f2673190c42aee74dcacc18668ecbd78ef4148f086f06176981426530f4be086e179ac50bce0d04a33f76d35da912fcc3d9aa9f9a05f6665491622db0
|
data/bin/kuport
CHANGED
|
@@ -5,37 +5,36 @@ require 'json'
|
|
|
5
5
|
|
|
6
6
|
using Kuport::ClassExtensions
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
example usage
|
|
8
|
+
example_usage = <<~USAGE
|
|
9
|
+
Example usage
|
|
11
10
|
|
|
12
|
-
# Get messages
|
|
13
|
-
kuport --id=jx91234 -m
|
|
11
|
+
# Get messages
|
|
12
|
+
kuport --id=jx91234 -m
|
|
14
13
|
|
|
15
14
|
|
|
16
|
-
# Get already read messages
|
|
17
|
-
kuport --id=jx91234 -m read
|
|
15
|
+
# Get already read messages
|
|
16
|
+
kuport --id=jx91234 -m read
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
# Login only(cache cookies)
|
|
21
|
-
kuport --id=jx91234
|
|
19
|
+
# Login only(cache cookies)
|
|
20
|
+
kuport --id=jx91234
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
# Download URL as NAME
|
|
25
|
-
kuport --download=NAME:URL
|
|
23
|
+
# Download URL as NAME
|
|
24
|
+
kuport --download=NAME:URL
|
|
26
25
|
|
|
27
26
|
|
|
28
|
-
# Download message attachment
|
|
29
|
-
json="$(kuport --id jx91234 -m | jq '.[0].links')"
|
|
30
|
-
kuport --download="$json"
|
|
27
|
+
# Download message attachment
|
|
28
|
+
json="$(kuport --id jx91234 -m | jq '.[0].links')"
|
|
29
|
+
kuport --download="$json"
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
# Interactively download message attachment
|
|
34
|
-
go get github.com/simeji/jid/cmd/jid
|
|
35
|
-
kuport --download="$(kuport --id jx91234 -m | jid)"
|
|
32
|
+
# Interactively download message attachment
|
|
33
|
+
go get github.com/simeji/jid/cmd/jid
|
|
34
|
+
kuport --download="$(kuport --id jx91234 -m | jid)"
|
|
36
35
|
|
|
37
|
-
# Download specific subjects materials
|
|
38
|
-
kuport --materials | kuport --filter='subject:Computer' | kuport --download
|
|
36
|
+
# Download specific subjects materials
|
|
37
|
+
kuport --materials | kuport --filter='subject:Computer' | kuport --download
|
|
39
38
|
USAGE
|
|
40
39
|
|
|
41
40
|
def debug?
|
|
@@ -96,6 +95,7 @@ parser = OptionParser.new do |o|
|
|
|
96
95
|
o.separator('')
|
|
97
96
|
|
|
98
97
|
o.separator('')
|
|
98
|
+
o.separator('------------------------------------------------------------')
|
|
99
99
|
o.on_tail(example_usage)
|
|
100
100
|
end
|
|
101
101
|
|
|
@@ -104,11 +104,10 @@ parser.permute!(ARGV)
|
|
|
104
104
|
opts = parser.options
|
|
105
105
|
|
|
106
106
|
# read config
|
|
107
|
-
config = {}
|
|
108
107
|
if File.readable?(RC_FILE)
|
|
109
|
-
config = JSON.parse(File.read(RC_FILE), {symbolize_names: true})
|
|
108
|
+
config = JSON.parse(File.read(RC_FILE), { symbolize_names: true })
|
|
109
|
+
opts.merge!(config) {|key, old, new| old }
|
|
110
110
|
end
|
|
111
|
-
config.each{|k,v| opts[k] = config[k] unless opts.has_key?(k)}
|
|
112
111
|
|
|
113
112
|
if debug?
|
|
114
113
|
warn "opts #{opts}"
|
data/lib/kuport/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kuport
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- u+
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-01-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
108
108
|
version: '0'
|
|
109
109
|
requirements: []
|
|
110
110
|
rubyforge_project:
|
|
111
|
-
rubygems_version: 2.
|
|
111
|
+
rubygems_version: 2.7.7
|
|
112
112
|
signing_key:
|
|
113
113
|
specification_version: 4
|
|
114
114
|
summary: Kuport scraping library and command
|