From 7ccfbeb2a6f007ecb13091e223dcc50dfc55aff6 Mon Sep 17 00:00:00 2001 From: osbm Date: Tue, 4 Feb 2025 17:52:49 +0300 Subject: [PATCH] update wanikani script --- modules/wanikani-tmux.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/wanikani-tmux.sh b/modules/wanikani-tmux.sh index 34fd88e..de74d03 100755 --- a/modules/wanikani-tmux.sh +++ b/modules/wanikani-tmux.sh @@ -5,6 +5,20 @@ # curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/assignments?immediately_available_for_review=true" | jq '.total_count' # lets store the output of the above command in a variable -wanikani_reviews=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/assignments?immediately_available_for_review=true" | jq '.total_count') -echo $wanikani_reviews \ No newline at end of file +get_wanikani() +{ + wanikani_reviews=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/assignments?immediately_available_for_review=true" | jq '.total_count') + wanikani_lessons=$(curl -s -H "Authorization: Bearer 2da24e4a-ba89-4c4a-9047-d08f21e9dd01" "https://api.wanikani.com/v2/assignments?immediately_available_for_lessons=true" | jq '.total_count') + + echo "WaniKani: $wanikani_reviews reviews, $wanikani_lessons lessons" +} + +main() +{ + get_wanikani + # sleep for 30 minutes + sleep 1800m +} + +main \ No newline at end of file