summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Kostovsky <nikita@kostovsky.me>2026-03-14 09:22:53 +0100
committerNikita Kostovsky <nikita@kostovsky.me>2026-03-14 09:22:53 +0100
commit76931bf5691846c8326ed52abfe5a7312affb18e (patch)
treeee93533009a3c14f09afce2cfe400126490411b7
initial commit
-rwxr-xr-xget_json.sh3
-rwxr-xr-xparse_json.sh2
-rwxr-xr-xshow_all.sh9
-rw-r--r--token12
4 files changed, 26 insertions, 0 deletions
diff --git a/get_json.sh b/get_json.sh
new file mode 100755
index 0000000..c2af20f
--- /dev/null
+++ b/get_json.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+WORD_ID=$1
+curl -s --ciphers DEFAULT@SECLEVEL=1 -X PUT https://info-car.pl/api/word/word-centers/exam-schedule -H "Content-type: application/json" -d '{"category":"A","wordId":"'${WORD_ID}'","startDate":"2026-03-14T11:59:11.990Z","endDate":"2026-05-15T10:59:11.990Z"}' -H "Accept: application/json, text/plain, */*" -H "Authorization: $(cat token)"
diff --git a/parse_json.sh b/parse_json.sh
new file mode 100755
index 0000000..3244880
--- /dev/null
+++ b/parse_json.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+jq '.schedule.scheduledDays[] | .scheduledHours[] | .practiceExams[] | "Date/time: \(.date); Places: \(.places); Price (pln): \(.amount);"'
diff --git a/show_all.sh b/show_all.sh
new file mode 100755
index 0000000..f1f584f
--- /dev/null
+++ b/show_all.sh
@@ -0,0 +1,9 @@
+DELAY_S=20
+
+while read l; do
+ echo "${l}";
+ ID=$(echo "${l}" | cut -d' ' -f 1)
+ ./get_json.sh ${ID} > ${ID}.json
+ cat ${ID}.json | ./parse_json.sh ${ID}
+ sleep ${DELAY_S}
+done < words
diff --git a/token b/token
new file mode 100644
index 0000000..f2c2abd
--- /dev/null
+++ b/token
@@ -0,0 +1,12 @@
+To get your token:
+- go to https://info-car.pl
+- register/login
+- go to https://info-car.pl/new/prawo-jazdy/sprawdz-wolny-termin
+- select "Egzamin na prawo jazdy (PKK)"
+- select any województwo/ośrodek/kategoria
+- open "Network Monitor" in your web-browser (ctrl+shift+e in Firefox)
+- press "Dalej"
+- PUT request to file `exam-schedule` has "Authorization" header, copy content to this file
+
+Example file content:
+Bearer YOUR_VERY_LONG_TOKEN