Created
May 26, 2016 12:46
-
-
Save cquest/0cdf032df241a31384b63e6ce5197e92 to your computer and use it in GitHub Desktop.
script to opt-out data from adresse-francaise.com
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
#!/bin/bash | |
# script to opt-out data from adresse-francaise.com | |
# usage: ./adresse-francaise-optout.sh <insee> | |
insee=$1 | |
fantoir=`curl -s "http://adresse-francaise.com/search.php?c=$insee" | egrep '<a href="street.php.i=[0-9][0-9AB][0-9]{3}[0-9A-Z][0-9]{3}' -o | sed 's/^.*=//'` | |
for f in $fantoir; do | |
echo $f | |
tel=`curl "http://adresse-francaise.com/street.php?i=$f" -s | egrep "<td>[0-9]{10}" -o | sed 's/<td>//'` | |
for t in $tel; do | |
curl 'http://adresse-francaise.com/btob.php' -H 'Host: adresse-francaise.com' --compressed -H 'Referer: http://adresse-francaise.com/contact.php' -H 'Connection: keep-alive' --data "phone=$t" -s > /dev/null | |
echo "$f $t" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Salut, je me suis amusé si cela t’intéresse. https://gist.github.com/563cac3de274de7a5222417d2bf5b4de