From c68e9523ea11640bd5089eddc2dcf6bca0aef765 Mon Sep 17 00:00:00 2001 From: osbm Date: Tue, 6 May 2025 02:43:19 +0300 Subject: [PATCH] update the new command --- modules/services/wanikani-bypass-lessons.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/services/wanikani-bypass-lessons.nix b/modules/services/wanikani-bypass-lessons.nix index 9108350..71695c5 100644 --- a/modules/services/wanikani-bypass-lessons.nix +++ b/modules/services/wanikani-bypass-lessons.nix @@ -20,12 +20,27 @@ echo "number of assignments: $(echo "$ASSIGNMENT_IDS" | wc -l)" + # "2017-09-05T23:41:28.980679Z" i need to create this from current time + + TIME_STRING=$(date -u +"%Y-%m-%dT%H:%M:%S.%6NZ") + echo "Current time:" + echo "$TIME_STRING" + # echo Starting assignments: for assignment_id in $ASSIGNMENT_IDS; do put_url="https://api.wanikani.com/v2/assignments/$assignment_id/start" # echo "PUT $put_url" - echo curl -X PUT -s -H "Authorization: Bearer $WANIKANI_TOKEN" "$put_url" - sleep 1 + curl "https://api.wanikani.com/v2/assignments/$assignment_id/start" \ + -X "PUT" \ + -H "Wanikani-Revision: 20170710" \ + -H "Content-Type: application/json; charset=utf-8" \ + -H "Authorization: Bearer $WANIKANI_TOKEN" \ + -d $'{ + "assignment": { + "started_at": $TIME_STRING + } + }' + sleep 1 done ''; };