Skip to content

Instantly share code, notes, and snippets.

@m0wer
Created October 28, 2024 16:27
Show Gist options
  • Select an option

  • Save m0wer/514bb0e7f079ad73032b3e0e01bca04f to your computer and use it in GitHub Desktop.

Select an option

Save m0wer/514bb0e7f079ad73032b3e0e01bca04f to your computer and use it in GitHub Desktop.
Obtain Mercadona warehouses
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
@m0wer

m0wer commented Oct 28, 2024

Copy link
Copy Markdown
Author

Result:

2004
2183
2275
2316
2343
2400
2549
2581
2595
2623
2717
2749
2875
2993
3004
3078
3118
3120
3280
3465
3532
3563
3681
3683
3684
3697
3700
3718
3729
3734
3750
3798
3819
3849
3855
3864
3880
3885
3902
3930
3947
3951
3968
4022
4028
4045
4055
4065
4069
4077
4113
4115
4140
4166
4168
4203
4211
4229
4230
4241
4246
4281
4290
4293
4308
4311
4315
4331
4364
4367
4375
4377
4383
4385
4389
4391
4402
4413
4416
4418
4427
4434
4436
4443
4472
4478
4480
4483
4491
4493
4508
4522
4534
4537
4544
4558
4568
4569
4570
4572
4644
4655
4659
4660
4661
4665
4671
4673
4677
4694
4701
4735
4766
4771
4777
4785
alc1
mad1
mad2
svq1
vlc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment