Skip to content

Instantly share code, notes, and snippets.

@cquest
Created May 26, 2016 12:46
Show Gist options
  • Save cquest/0cdf032df241a31384b63e6ce5197e92 to your computer and use it in GitHub Desktop.
Save cquest/0cdf032df241a31384b63e6ce5197e92 to your computer and use it in GitHub Desktop.
script to opt-out data from adresse-francaise.com
#!/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
Copy link

ghost commented Jun 15, 2016

Salut, je me suis amusé si cela t’intéresse. https://gist.github.com/563cac3de274de7a5222417d2bf5b4de

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