update the new command

This commit is contained in:
Osman Faruk Bayram 2025-05-06 02:43:19 +03:00
parent 459e06864f
commit c68e9523ea

View file

@ -20,12 +20,27 @@
echo "number of assignments: $(echo "$ASSIGNMENT_IDS" | wc -l)" 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: # echo Starting assignments:
for assignment_id in $ASSIGNMENT_IDS; do for assignment_id in $ASSIGNMENT_IDS; do
put_url="https://api.wanikani.com/v2/assignments/$assignment_id/start" put_url="https://api.wanikani.com/v2/assignments/$assignment_id/start"
# echo "PUT $put_url" # echo "PUT $put_url"
echo curl -X PUT -s -H "Authorization: Bearer $WANIKANI_TOKEN" "$put_url" curl "https://api.wanikani.com/v2/assignments/$assignment_id/start" \
sleep 1 -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 done
''; '';
}; };