Commit 92565f4d authored by Tangui's avatar Tangui

Récupération des ordonnances du TA suite au rejet du CE

parent b53e7c00
telerecours.cookies
requetes
requetes.json
This diff is collapsed.
#!/bin/bash
mkdir -p requetes
cd requetes
wget -O requetes.json --load-cookies=../telerecours.cookies https://citoyens.telerecours.fr/api/requetes
json_pp < requetes.json | grep '"id"' | awk '{print $3}' | sed 's/,//' | while read id ; do wget -O "requete_"$id".json" --load-cookies=../telerecours.cookies https://citoyens.telerecours.fr/api/requetes/32254 ; done
ls requete_*json | while read json ; do id=$(json_pp < $json | grep -B 10 "Notification d" | grep id | sed 's/[^0-9]*//g') ; rid=$(echo $json | sed 's/[^0-9]//g'); file=$(json_pp < $json | grep -A 30 $id | grep -B 5 '.doc'| grep fileApi | awk -F '"' '{print $4}' ) ; notif=$(json_pp < $json | grep AccuseNotification > /dev/null && echo "NotifOK") ; requete=$(json_pp < $json | grep numeroRequete | awk -F '"' '{print $4}'); echo $rid" "$id" "$file" "$requete" "$notif; done > ../ordonnances.list
cat ordonnance.list | awk '{if ( $5 == "NotifOK" )
print "wget -O ordonnance_"$1"_"$4".pdf --load-cookies=../telerecours.cookies " \
"--post-data='"'"'{\"origin\": \"TR_PJ_COPY\",\"typeEvent\": null,\"fileName\": \""$3"_doc.pdf\"}'"'"' " \
"--header=\"content-type: application/json\" " \
"https://citoyens.telerecours.fr/api/requetes/"$1"/events/"$2"/pieces/"$3"/download"}' | sh
# HTTP cookie file.
# Generated by Wget on 2020-05-25 10:17:34.
# Edit at your own risk.
.telerecours.fr TRUE / TRUE 1592986654 JSESSIONID XXXXXXXXXXXXXXXXXXXXXXXXX
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment