· 7 years ago · Sep 19, 2018, 04:16 PM
1<?php
2set_time_limit(0);
3ignore_user_abort();
4
5
6$accessID ="mozscape-807a413de5";
7$secretKey = "b07ba547bcc299a6d5ff654e13277fb7";
8
9
10
11$expires = time() + 30000000;
12$stringToSign = $accessID."\n".$expires;
13$binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true);
14$urlSafeSignature = urlencode(base64_encode($binarySignature));
15
16
17$cols = '2251902892908544';//$cols = '68719476740';
18
19$requestUrl = "http://lsapi.seomoz.com/linkscape/url-metrics/?Cols=".$cols."&AccessID=".$accessID."&Expires=".$expires."&Signature=".$urlSafeSignature;
20
21$list_domain=array("ya.ru","xseo.in");
22
23$tar=array_chunk($list_domain,10);
24$count=0;
25$limit=0;
26foreach ($tar as $dm)
27{
28
29$encodedDomains = json_encode($dm);
30
31$options = array(CURLOPT_RETURNTRANSFER => true,CURLOPT_POSTFIELDS => $encodedDomains);
32$ch = curl_init($requestUrl);
33curl_setopt_array($ch, $options);
34$content = curl_exec($ch);
35curl_close( $ch );
36$contents = json_decode($content,1);
37print_r($contents);
38 sleep(10);
39}
40?>