Skip to content

Instantly share code, notes, and snippets.

@AurelienLavorel
Created June 25, 2015 19:33
Show Gist options
  • Save AurelienLavorel/5609769abe835de918ec to your computer and use it in GitHub Desktop.
Save AurelienLavorel/5609769abe835de918ec to your computer and use it in GitHub Desktop.
Use special DC for scrapping Google by LavoWeb
<?php
$dc = "173.194.44.35";
$tld = "com";
$ch = curl_init("http://" . $dc);
curl_setopt($ch, CURLOPT_HEADER, "Host: www.google." . $tld);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0');
$content = curl_exec($ch);
curl_close($ch);
echo $content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment