first cleaning
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user