diff --git a/README.md b/README.md index 993d45a..885db2b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# pad_scrapper +# Pad Scrapper +Ce script a pour objectif de consulter les pads de l'erg dans une perspective de recherche autour de la question "comment fait-on école ?" lancée en 2025. diff --git a/pad_scrapper.sh b/pad_scrapper.sh index 9f97b2a..c05b1e1 100755 --- a/pad_scrapper.sh +++ b/pad_scrapper.sh @@ -5,13 +5,14 @@ password=$(< password-admin.txt) token=$(curl "https://pads.erg.be/oidc/token" -X POST -H 'content-type: application/x-www-form-urlencoded' --data grant_type=client_credentials --data client_id="$login" --data client_secret="$password" -s | jq .access_token -r) -#curl "https://pads.erg.be/api/1/getText?&padID=erg-nomade " -H "Authorization: Bearer $token" listAllPads_array=($(curl "https://pads.erg.be/api/1.2.1/listAllPads" -H "Authorization: Bearer $token" | jq '.data.padIDs | @sh' -r | tr -d \')) -# echo "array: ${listAllPads_array[@]}" # debug -# echo "length: ${#listAllPads_array[@]}" # debug +numberOfPads=${#listAllPads_array[@]} +i=1 for padID in "${listAllPads_array[@]}" do + echo $i "/" $numberOfPads + ((i+=1)) no_publish=$(curl -s "https://pads.erg.be/api/1/getText?&padID=$padID" -H "Authorization: Bearer $token" | grep "__NOPUBLISH__") if [ -n "$no_publish" ] then