Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.20 KB | None | 0 0
  1. <?php
  2.  
  3. //error_reporting(E_ALL);
  4.  
  5. if (isset($_REQUEST['parsit'])) {
  6. //$top=10;
  7. $row_index = 1;
  8. $t1 = trim($_REQUEST['t1']);
  9. $mass = explode("\n", $t1);
  10.  
  11. $region = $_REQUEST['inputtype'];
  12.  
  13. //echo '<b>************************************************************</b>';
  14. //echo '<br/>OK LET\'S Go. ';
  15. //print_r($mass);
  16.  
  17.  
  18. $domi = [];
  19. $rez = [];
  20. for ($i = 0; $i < count($mass); $i++) {
  21. flush();
  22. if (!$domi[getDomain($mass[$i])]) {
  23. $domi[getDomain($mass[$i])] = 1;
  24. }
  25. }
  26.  
  27. $doms = array_keys($domi);
  28.  
  29. $ds = [];
  30. for ($i = 0; $i < count($mass); $i++) {
  31. $ds[] = trim(getDomain($mass[$i]));
  32. }
  33.  
  34. //print_r($ds);
  35.  
  36. //echo '<br/>Domain;CF;TF;In Domains;In Links;In IPS;In CSs';
  37. echo '<table cellpadding="0" cellspacing="0" class="sortable" border="0" id="table">';
  38. echo '<thead>';
  39. echo '<tr>';
  40. echo '<th><h3>ID</h3></th>';
  41. echo '<th><h3>Domain</h3></th>';
  42. echo '<th class="nosort"><h3> Redirects</h3></th>';
  43. //echo '<th class="nosort"><h3> Index</h3></th>';
  44. echo '<th><h3> TF</h3></th>';
  45. echo '<th><h3> CF</h3></th>';
  46. echo '<th style="display:none;"><h3> RefDomains</h3></th>';
  47. echo '<th style="display:none;"><h3> Backlinks</h3></th>';
  48. echo '<th class="nosort"><h3>Topic1</h3></th>';
  49. echo '<th class="nosort"><h3>Topic2</h3></th>';
  50. echo '<th style="display:none;" class="nosort"><h3>Topic3</h3></th>';
  51. echo '<th style="display:none;" class="nosort"><h3>Topic4</h3></th>';
  52. echo '<th style="display:none;"><h3> EDU-links</h3></th>';
  53. echo '<th style="display:none;"><h3> GOV-links</h3></th>';
  54. echo '<th class="nosort" style="display:none;"><h3> Lang</h3></th>';
  55. echo '<th><h3> In Domains</h3></th>';
  56. echo '<th><h3> In Links</h3></th>';
  57. echo '<th style="display:none;"><h3> In IPS</h3></th>';
  58. echo '<th style="display:none;"><h3> In CSs</h3></th>';
  59. echo '<th class="nosort"><h3> Serpstat</h3></th>';
  60. echo '<th class="nosort"><h3> Web Archive</h3></th>';
  61. echo '</tr>';
  62. echo '</thead>';
  63. echo '<tbody>';
  64.  
  65.  
  66. for ($i = 0; $i < count($ds); $i++) {
  67. $d = $ds[$i];
  68. $token = "C5AF3A274EEF2BF25F25138FA822D941"; //КЛЮЧ
  69. $req = 'http://api.majestic.com/api/json?app_api_key=' . $token . '&cmd=GetIndexItemInfo&items=2&item0=' . $d . '&item1=www.' . $d . '&datasource=fresh&AddAllTopics=0&DesiredTopics=0&datasource=fresh';
  70. $req_topic = 'https://api.majestic.com/api/json?app_api_key=' . $token . '&cmd=GetIndexItemInfo&items=1&item0=' . $d . '&datasource=fresh';
  71. //echo '<br/>'.$req;
  72. $ppg = getAhrefsBar($req);
  73. $topic = getAhrefsBar($req_topic);
  74. $topic_json = json_decode($topic, true);
  75. $tp1 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_0"];
  76. $tp2 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_1"];
  77. $tp3 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_2"];
  78. $tp4 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_3"];
  79. //echo '<br/>'.$ppg;
  80.  
  81. if (strpos($ppg, "TrustFlow", 0) > -1) {
  82. //echo '<br/>';
  83. $resjson = json_decode($ppg, true);
  84. //print_r($resjson);
  85. //echo '<br/>';
  86. $rd = $resjson["DataTables"]["Results"]["Data"][0]["RedirectFlag"];//RedirectFlag
  87. $cu = (int)($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinksEDU"]);
  88. $gov = (int)($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinksGOV"]);
  89. $tf = (int)($resjson["DataTables"]["Results"]["Data"][0]["TrustFlow"]);
  90. $cf = (int)($resjson["DataTables"]["Results"]["Data"][0]["CitationFlow"]);
  91. $extdom = (int)($resjson["DataTables"]["Results"]["Data"][0]["RefDomains"]);
  92. $extback = (int)($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinks"]);
  93. $lan = $resjson["DataTables"]["Results"]["Data"][0]["Language"];
  94. $links = round($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinks"], 0);
  95. $doms = round($resjson["DataTables"]["Results"]["Data"][0]["RefDomains"], 0);
  96. $ips = round($resjson["DataTables"]["Results"]["Data"][0]["RefIPs"], 0);
  97. $cs = (int)($resjson["DataTables"]["Results"]["Data"][0]["RefSubNets"]);
  98. $wwwrd = $resjson["DataTables"]["Results"]["Data"][0]["RedirectFlag"];
  99. $wwwcu = (int)($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinksEDU"]);
  100. $wwwgov = (int)($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinksGOV"]);
  101. $wwwtf = (int)($resjson["DataTables"]["Results"]["Data"][1]["TrustFlow"]);
  102. $wwwcf = (int)($resjson["DataTables"]["Results"]["Data"][1]["CitationFlow"]);
  103. $wwwextdom = (int)($resjson["DataTables"]["Results"]["Data"][1]["RefDomains"]);
  104. $wwwextback = (int)($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinks"]);
  105. $wwwlan = $resjson["DataTables"]["Results"]["Data"][0]["Language"];
  106. $wwwlinks = round($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinks"], 0);
  107. $wwwdoms = round($resjson["DataTables"]["Results"]["Data"][1]["RefDomains"], 0);
  108. $wwwips = round($resjson["DataTables"]["Results"]["Data"][1]["RefIPs"], 0);
  109. $wwwcs = (int)($resjson["DataTables"]["Results"]["Data"][1]["RefSubNets"]);
  110.  
  111.  
  112. if ((($wwwtf > 0) && ($wwwtf / $tf > 0.5) && ($wwwdoms / $doms > 0.5)) || (($wwwtf > 0) && ($tf == 0))) {
  113. $allrd = $wwwrd;
  114. $allcu = $wwwcu;
  115. $allgov = $wwwgov;
  116. $alltf = $wwwtf;
  117. $allcf = $wwwcf;
  118. $extdom = $wwwextdom;
  119. $extback = $wwwextback;
  120. $alllan = $wwwlan;
  121. $alllinks = $wwwlinks;
  122. $alldoms = $wwwdoms;
  123. $allips = $wwwips;
  124. $allcs = $wwwcs;
  125. } else {
  126. $allrd = $rd;
  127. $allcu = $cu;
  128. $allgov = $gov;
  129. $alltf = $tf;
  130. $allcf = $cf;
  131. $allextdom = $extdom;
  132. $allextback = $extback;
  133. $alllan = $lan;
  134. $alllinks = $links;
  135. $alldoms = $doms;
  136. $allips = $ips;
  137. $allcs = $cs;
  138. }
  139. //echo '<br/>CF:'.$cf.'/'.$wwwcf.'('.$allcf.');TF:'.$tf.'/'.$wwwtf.'('.$alltf.');DOMS:'.$doms.'/'.$wwwdoms.'('.$alldoms.');LINKS:'.$links.'/'.$wwwlinks.'('.$alllinks.')<br/>IPS: '.$allips.'; CS: '.$allcs.'<br/>';
  140. flush();
  141.  
  142. //echo '<br/>'.$d.';'.$allcf.';'.$alltf.';'.$alldoms.';'.$alllinks.';'.$allips.';'.$allcs;
  143. echo '<tr>';
  144. echo '<td>' . $row_index++ . '</td>';
  145. echo '<td><a href=https://www.google.com.ua/search?q=site:' . $d . ' class="c" target="_blank">' . $d . '</a></td>';
  146. echo '<td>' . $allrd . '</td>';
  147. //echo '<td><a href=https://www.google.com.ua/search?q=site:'.$d.' class="c" target="_blank">link</a></td>';
  148. echo '<td>' . $alltf . '</td>';
  149. echo '<td>' . $allcf . '</td>';
  150. echo '<td style="display:none;">' . $allextdom . '</td>';
  151. echo '<td style="display:none;">' . $allextback . '</td>';
  152. echo '<td>' . $tp1 . '</td>';
  153. echo '<td>' . $tp2 . '</td>';
  154. echo '<td style="display:none;">' . $tp3 . '</td>';
  155. echo '<td style="display:none;">' . $tp4 . '</td>';
  156. echo '<td style="display:none;">' . $allcu . '</td>';
  157. echo '<td style="display:none;">' . $allgov . '</td>';
  158. echo '<td style="display:none;">' . $alllan . '</td>';
  159. echo '<td>' . $alldoms . '</td>';
  160. echo '<td>' . $alllinks . '</td>';
  161. echo '<td style="display:none;">' . $allips . '</td>';
  162. echo '<td style="display:none;">' . $allcs . '</td>';
  163. echo '<td><a href="https://serpstat.com/ru/backlink/dashboard/?search_type=domain_with_subdomains&query=www.' . $d . '&se=g_us" class="c" target="_blank">www</a> <a href="https://serpstat.com/ru/backlink/dashboard/?search_type=domain_with_subdomains&query=' . $d . '&se=g_us" class="c" target="_blank">non-www</a></td>';
  164. echo '<td><a href="https://web.archive.org/web/*/' . $d . '" class="c" target="_blank">Archive</a></td>';
  165. echo '</tr>';
  166.  
  167.  
  168. } else {
  169. echo '<br/>' . $d . '<a style="color:red;">ERROR</a>';
  170. }
  171. }
  172.  
  173.  
  174. //print_r($rez);
  175.  
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement