wkcheck 0.0.8 → 0.0.9
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 +42 -3
- data/bin/wkcheck +14 -0
- data/lib/wkcheck/critical_items.rb +35 -0
- data/lib/wkcheck/version.rb +1 -1
- data/lib/wkcheck.rb +1 -0
- data/wkcheck.gemspec +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40d8d23291afd61aa33db1fb966363ed12c5dfcd
|
4
|
+
data.tar.gz: 88888eaf9efcbbdc0c2d599ead371b509799ebde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e68116d25755b19b96116e4428f64d34264e17d18fd108cac1b7e9ec3cee51799707c016fcf8513b21fc390acb6dc02c82acd8445d86f4bdc186875f5b7dbe9
|
7
|
+
data.tar.gz: 72a03f419d8c34858f0e2f707592d1f320f8e767760078529995c320ad3aa08c732c2ef4cbb766552e37e1feefcc7b437a1a8feead5e4cf080ed951ec59a6696
|
data/README.md
CHANGED
@@ -17,10 +17,14 @@ $ wkcheck --api-key=YOUR_WANIKANI_API_KEY
|
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
20
|
-
Once the API Key is saved,
|
20
|
+
Once the API Key is saved, you can check fetch different types of information from your WaniKani account (run `wkcheck` to see the different options).
|
21
|
+
|
22
|
+
### Current study queue
|
23
|
+
|
24
|
+
Displays how many new lessons and current reviews you have pending.
|
21
25
|
|
22
26
|
```
|
23
|
-
$ wkcheck
|
27
|
+
$ wkcheck -q
|
24
28
|
You have no lessons pending.
|
25
29
|
You have 93 reviews pending.
|
26
30
|
```
|
@@ -28,10 +32,45 @@ You have 93 reviews pending.
|
|
28
32
|
If you don't have any lessons or reviews pending, you'll be able to see when your next review will come up.
|
29
33
|
|
30
34
|
```
|
31
|
-
$ wkcheck
|
35
|
+
$ wkcheck -q
|
32
36
|
You have no lessons or reviews now! You'll have some more on Sunday, May 10 at 8:45 AM.
|
33
37
|
```
|
34
38
|
|
39
|
+
### Current level progression
|
40
|
+
|
41
|
+
Displays the number of radicals and kanji that have passed 'Apprentice' status for your current level.
|
42
|
+
|
43
|
+
```
|
44
|
+
$ wkcheck -l
|
45
|
+
Your progress for level 18:
|
46
|
+
0 out of 8 Radicals (0.0%)
|
47
|
+
2 out of 29 Kanji (6.9%)
|
48
|
+
```
|
49
|
+
|
50
|
+
### Critical items
|
51
|
+
|
52
|
+
Displays your current criticals under a certain percentage of correctness (default: 75).
|
53
|
+
|
54
|
+
```
|
55
|
+
$ wkcheck -c
|
56
|
+
Your Critical Items - Max percentage: 75 (Kanji, Radicals, Vocabulary):
|
57
|
+
了 (りょう) - finish, complete, end
|
58
|
+
感覚 (かんかく) - senses, the senses
|
59
|
+
```
|
60
|
+
|
61
|
+
You can also specify an integer to change the max percentage of correctness.
|
62
|
+
|
63
|
+
```
|
64
|
+
$ wkcheck -c 85
|
65
|
+
Your Critical Items - Max percentage: 85 (Kanji, Radicals, Vocabulary):
|
66
|
+
栄 (えい) - prosperity, flourish
|
67
|
+
署 (しょ) - government office, political office, office
|
68
|
+
隹 - turkey
|
69
|
+
去 - cemetery
|
70
|
+
上がる (あがる) - to rise
|
71
|
+
商売 (しょうばい) - business, commerce
|
72
|
+
```
|
73
|
+
|
35
74
|
## Contributing
|
36
75
|
|
37
76
|
I'll be super-happy if you guys help giving back! If you want to do some hacking on wkcheck for your needs, this is a good guideline to get started:
|
data/bin/wkcheck
CHANGED
@@ -12,6 +12,7 @@ opts = Slop.parse(help: true) do
|
|
12
12
|
on "api-key=", "Saves your WaniKani API Key to #{WKCheck::CONFIG_FILE}"
|
13
13
|
on "q", "queue", "Displays your current study queue (new lessons / pending reviews)"
|
14
14
|
on "l", "level", "Displays your current level progression (radicals / Kanji)"
|
15
|
+
on "c", "critical", "Displays your current critical items, with an optional argument to set the maximum percentage", argument: :optional
|
15
16
|
on "v", "version", "Show version number and quit" do
|
16
17
|
puts "wkcheck #{WKCheck::VERSION}"
|
17
18
|
exit
|
@@ -48,5 +49,18 @@ if opts.level?
|
|
48
49
|
exit
|
49
50
|
end
|
50
51
|
|
52
|
+
if opts.critical?
|
53
|
+
percentage = opts["critical"] || 75
|
54
|
+
|
55
|
+
if percentage.to_i.between?(1, 99)
|
56
|
+
critical = WKCheck::CriticalItems.new(percentage.to_i)
|
57
|
+
puts critical.critical_items
|
58
|
+
exit
|
59
|
+
else
|
60
|
+
puts "The maximum percentage should be between 1 and 99!"
|
61
|
+
exit 1
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
51
65
|
# No flags / Invalid flags - Display the help.
|
52
66
|
puts opts.help
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module WKCheck
|
2
|
+
class CriticalItems
|
3
|
+
def initialize(percentage)
|
4
|
+
@percentage = percentage
|
5
|
+
end
|
6
|
+
|
7
|
+
def critical_items
|
8
|
+
critical = Wanikani::CriticalItems.critical(@percentage).sort_by { |item| item["type"] }
|
9
|
+
|
10
|
+
if critical.empty?
|
11
|
+
Rainbow("Awesome, you have no items under #{@percentage} percent correct! Keep on rockin'!").bright.green
|
12
|
+
else
|
13
|
+
summary = Rainbow("Your Critical Items - Max percentage: #{@percentage} ").bright.white
|
14
|
+
summary += "(#{Rainbow('Kanji').red}, #{Rainbow('Radicals').cyan}, #{Rainbow('Vocabulary').magenta}):\n"
|
15
|
+
summary += critical.map { |item| send("#{item["type"]}_info", item) }.compact.join("\n")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def kanji_info(item)
|
22
|
+
important_reading = item["important_reading"]
|
23
|
+
"#{Rainbow(item["character"]).red} #{Rainbow("(#{item[important_reading]})").red} - #{item["meaning"]}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def vocabulary_info(item)
|
27
|
+
"#{Rainbow(item["character"]).magenta} #{Rainbow("(#{item["kana"]})").magenta} - #{item["meaning"]}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def radical_info(item)
|
31
|
+
return nil if item["character"].nil?
|
32
|
+
"#{Rainbow(item["character"]).cyan} - #{item["meaning"]}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/wkcheck/version.rb
CHANGED
data/lib/wkcheck.rb
CHANGED
data/wkcheck.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'wkcheck/version'
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "wkcheck"
|
8
8
|
s.version = WKCheck::VERSION
|
9
|
-
s.date = "2014-04-
|
9
|
+
s.date = "2014-04-14"
|
10
10
|
s.summary = "Check your WaniKani stats from the command line"
|
11
11
|
s.description = "Check your pending lessons and reviews of your WaniKani account (http://www.wanikani.com/) from the command line"
|
12
12
|
s.authors = ["Dennis Martinez"]
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
wkcheck.gemspec
|
22
22
|
lib/wkcheck.rb
|
23
23
|
lib/wkcheck/stats.rb
|
24
|
+
lib/wkcheck/critical_items.rb
|
24
25
|
lib/wkcheck/version.rb
|
25
26
|
]
|
26
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wkcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Martinez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wanikani
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- README.md
|
106
106
|
- bin/wkcheck
|
107
107
|
- lib/wkcheck.rb
|
108
|
+
- lib/wkcheck/critical_items.rb
|
108
109
|
- lib/wkcheck/stats.rb
|
109
110
|
- lib/wkcheck/version.rb
|
110
111
|
- wkcheck.gemspec
|