Advertisement
AbdulMuttaqin

Alexa

Mar 29th, 2019
711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. $list = "/path.txt";
  2. $urlParts  = file_get_contents($list);
  3. $urlParts = parse_url($hmms);
  4. // remove www
  5. $domain = preg_replace('/^www\./', '', $urlParts['host']);
  6. $curl = curl_init();
  7. curl_setopt($curl, CURLOPT_URL, "https://www.alexa.com/siteinfo/$domain");
  8. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  9. curl_setopt($curl, CURLOPT_HEADER, false);
  10. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  11. $exec = curl_exec($curl);
  12. curl_close($curl);
  13. preg_match_all("/<a href='(.*?)' title='(.*?)'>(.*?)<\/a>/", $exec, $hasil);
  14. preg_match_all('/<strong class="(.*?)">\n(.*?)<\/strong>/', $exec, $hasil2);
  15. preg_match_all('/<strong class="(.* ?)">\n(.* ?)>\n(.*?)<\/strong>/', $exec, $hasil3);
  16.  print "Domain       : $domain \n";
  17.  print "Country      : ".$hasil[3][0]."\n";
  18.  print "Local Rank   :\033[1;31m ".$hasil2[2][0]."\033[0m \n";
  19.  print "Global Rank  : \033[1;33m".$hasil3[3][0]."\033[0m \n";
  20.  print "+--------------------------------+\n";
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement