A Bash script to monitor 'Echange d'un permis de conduire hors Union Européenne' rendez-vous availability at Prefecture de Paris
rendezvous_echange_permis_conduire_paris.sh
Prefecture Nantes Permis De Conduire
#! /bin/bash |
#Usage: |
# 1. Download the script to Home folder and open the Terminal |
# 2. Put in your e-mail and SendGrid bearer token to get a notification of success |
# 3. Open the Terminal and run the script: '$ bash ~/rendezvous_echange_permis_conduire_paris.sh' |
# 4. Get your RDV! Right now the script will exit once it found a RDV available. It would dump the HTML of the page to '~/rendezvous_naturalisation_saint_denis.sh.html'. Comment the line 38 to continue checking. |
set -e |
SENDGRID_BEARER_TOKEN=''# should start with 'SG.' |
SENDGRID_EMAIL=''# put your e-mail here |
TIMEOUT=30 # timeout between checks in seconds |
URL='https://www.rdv-permisdeconduire-ppol.interieur.gouv.fr/eAppointment/dwr/call/plaincall/AjaxSelectionFormFeeder.getClosedDaysList.dwr' |
URLCOOKIE='https://www.rdv-permisdeconduire-ppol.interieur.gouv.fr/eAppointment/appointment.do?preselectservice=PAR&sitekey=site2&userZip=75001' |
NORDV='125' |
ERROR='Throwable' |
whiletrue;do |
OUTPUT=$(curl -sS $URL -H 'Content-Type: text/plain' -H 'Cookie: $COOKIE' --data-binary $'callCount=1npage=/eAppointment/element/jsp/appointment.jspnhttpSessionId=nscriptSessionId=6D8501EBAC2D852925C5C905DE21B23A147nc0-scriptName=AjaxSelectionFormFeedernc0-methodName=getClosedDaysListnc0-id=0nc0-param0=boolean:falsenc0-param1=string:site2nc0-param2=string:760nbatchId=1n' -L --connect-timeout $TIMEOUT --max-time $TIMEOUT| tail -n 1 ||echo'$ERROR') |
if [[ '$OUTPUT'*'$ERROR'* ]];then |
echo'$(date) Error: $OUTPUT' |
echo'$(date) Need new cookie' |
COOKIE='JSESSIONID=$(curl -sSi $URLCOOKIE --connect-timeout $TIMEOUT --max-time $TIMEOUT| grep Location: | sed 's/jsessionid=/n/g'| tail -n 1)' |
echo'$(date) Set cookie: $COOKIE' |
elif [[ $(echo $OUTPUT| sed 's/'/n/g'| wc -l)*'$NODRV'* ]];then |
echo'$(date) No rendez-vous available. Next 62 days taken: $OUTPUT' |
else |
echo'$(date) YHOO! RDV ON INTERWEBZ. GET IT FOR THE DAY MISSING FROM THE LIST (YYYY-MM-DD): $OUTPUT' |
echo'$OUTPUT'>'$0.html' |
if [[ '$SENDGRID_BEARER_TOKEN' ]];then |
curl -sS -X POST https://api.sendgrid.com/api/mail.send.json -H 'Authorization: Bearer $SENDGRID_BEARER_TOKEN' -d 'to=$SENDGRID_EMAIL' -d 'from=$SENDGRID_EMAIL' -d 'subject=RDV available' -d'text=$URLCOOKIE' |
fi |
exit 0 # comment to continue even after an available RDV was found |
fi |
sleep $TIMEOUT |
done |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
I applied last October. My UK licence was due to expire in December as I reached the age of 70. By late November I had received nothing. My UK ..
To read the remaining 85% of this article, you need to either
Subscribe now to The Connexion and benefit from access to our archived articles since 2006
How to delete from one drive. Pay every three months. Our most flexible subscription.
Subscription automatically renews so you don't miss an edition (you can switch this off at any time)
1 Year Subscription (12 editions) (Our best value offer)
1 year of great reading in print and online Wolverine movie sub indonesia.
Subscription automatically renews so you don't miss an edition (you can switch this off at any time).