Created
October 28, 2024 16:27
-
-
Save m0wer/514bb0e7f079ad73032b3e0e01bca04f to your computer and use it in GitHub Desktop.
Obtain Mercadona warehouses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -O https://raw.githubusercontent.com/inigoflores/ds-codigos-postales-ine-es/refs/heads/master/data/codigos_postales_municipios.csv | |
| tail -n +2 codigos_postales_municipios.csv | \ | |
| cut -d',' -f1 | \ | |
| sort -u | \ | |
| while read code; do \ | |
| curl -s -H 'Content-Type: application/json' \ | |
| -d "{\"new_postal_code\": $code}" \ | |
| -D - \ | |
| https://tienda.mercadona.es/api/postal-codes/actions/change-pc/ \ | |
| | grep -i "x-customer-wh" \ | |
| | cut -d: -f2 \ | |
| | tr -d ' ' \ | |
| | sort -u; \ | |
| done | sort -u | |
| # wait a looong time |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result: