Skip to content

Instantly share code, notes, and snippets.

@esafwan
Forked from AurelienLavorel/datacenter_google.php
Created December 25, 2015 21:20
Show Gist options
  • Save esafwan/0cca954f10741a2ad6df to your computer and use it in GitHub Desktop.
Save esafwan/0cca954f10741a2ad6df 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