Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //error_reporting(E_ALL);
- if (isset($_REQUEST['parsit'])) {
- //$top=10;
- $row_index = 1;
- $t1 = trim($_REQUEST['t1']);
- $mass = explode("\n", $t1);
- $region = $_REQUEST['inputtype'];
- //echo '<b>************************************************************</b>';
- //echo '<br/>OK LET\'S Go. ';
- //print_r($mass);
- $domi = [];
- $rez = [];
- for ($i = 0; $i < count($mass); $i++) {
- flush();
- if (!$domi[getDomain($mass[$i])]) {
- $domi[getDomain($mass[$i])] = 1;
- }
- }
- $doms = array_keys($domi);
- $ds = [];
- for ($i = 0; $i < count($mass); $i++) {
- $ds[] = trim(getDomain($mass[$i]));
- }
- //print_r($ds);
- //echo '<br/>Domain;CF;TF;In Domains;In Links;In IPS;In CSs';
- echo '<table cellpadding="0" cellspacing="0" class="sortable" border="0" id="table">';
- echo '<thead>';
- echo '<tr>';
- echo '<th><h3>ID</h3></th>';
- echo '<th><h3>Domain</h3></th>';
- echo '<th class="nosort"><h3> Redirects</h3></th>';
- //echo '<th class="nosort"><h3> Index</h3></th>';
- echo '<th><h3> TF</h3></th>';
- echo '<th><h3> CF</h3></th>';
- echo '<th style="display:none;"><h3> RefDomains</h3></th>';
- echo '<th style="display:none;"><h3> Backlinks</h3></th>';
- echo '<th class="nosort"><h3>Topic1</h3></th>';
- echo '<th class="nosort"><h3>Topic2</h3></th>';
- echo '<th style="display:none;" class="nosort"><h3>Topic3</h3></th>';
- echo '<th style="display:none;" class="nosort"><h3>Topic4</h3></th>';
- echo '<th style="display:none;"><h3> EDU-links</h3></th>';
- echo '<th style="display:none;"><h3> GOV-links</h3></th>';
- echo '<th class="nosort" style="display:none;"><h3> Lang</h3></th>';
- echo '<th><h3> In Domains</h3></th>';
- echo '<th><h3> In Links</h3></th>';
- echo '<th style="display:none;"><h3> In IPS</h3></th>';
- echo '<th style="display:none;"><h3> In CSs</h3></th>';
- echo '<th class="nosort"><h3> Serpstat</h3></th>';
- echo '<th class="nosort"><h3> Web Archive</h3></th>';
- echo '</tr>';
- echo '</thead>';
- echo '<tbody>';
- for ($i = 0; $i < count($ds); $i++) {
- $d = $ds[$i];
- $token = "C5AF3A274EEF2BF25F25138FA822D941"; //КЛЮЧ
- $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';
- $req_topic = 'https://api.majestic.com/api/json?app_api_key=' . $token . '&cmd=GetIndexItemInfo&items=1&item0=' . $d . '&datasource=fresh';
- //echo '<br/>'.$req;
- $ppg = getAhrefsBar($req);
- $topic = getAhrefsBar($req_topic);
- $topic_json = json_decode($topic, true);
- $tp1 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_0"];
- $tp2 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_1"];
- $tp3 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_2"];
- $tp4 = $topic_json["DataTables"]["Results"]["Data"][0]["TopicalTrustFlow_Topic_3"];
- //echo '<br/>'.$ppg;
- if (strpos($ppg, "TrustFlow", 0) > -1) {
- //echo '<br/>';
- $resjson = json_decode($ppg, true);
- //print_r($resjson);
- //echo '<br/>';
- $rd = $resjson["DataTables"]["Results"]["Data"][0]["RedirectFlag"];//RedirectFlag
- $cu = (int)($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinksEDU"]);
- $gov = (int)($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinksGOV"]);
- $tf = (int)($resjson["DataTables"]["Results"]["Data"][0]["TrustFlow"]);
- $cf = (int)($resjson["DataTables"]["Results"]["Data"][0]["CitationFlow"]);
- $extdom = (int)($resjson["DataTables"]["Results"]["Data"][0]["RefDomains"]);
- $extback = (int)($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinks"]);
- $lan = $resjson["DataTables"]["Results"]["Data"][0]["Language"];
- $links = round($resjson["DataTables"]["Results"]["Data"][0]["ExtBackLinks"], 0);
- $doms = round($resjson["DataTables"]["Results"]["Data"][0]["RefDomains"], 0);
- $ips = round($resjson["DataTables"]["Results"]["Data"][0]["RefIPs"], 0);
- $cs = (int)($resjson["DataTables"]["Results"]["Data"][0]["RefSubNets"]);
- $wwwrd = $resjson["DataTables"]["Results"]["Data"][0]["RedirectFlag"];
- $wwwcu = (int)($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinksEDU"]);
- $wwwgov = (int)($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinksGOV"]);
- $wwwtf = (int)($resjson["DataTables"]["Results"]["Data"][1]["TrustFlow"]);
- $wwwcf = (int)($resjson["DataTables"]["Results"]["Data"][1]["CitationFlow"]);
- $wwwextdom = (int)($resjson["DataTables"]["Results"]["Data"][1]["RefDomains"]);
- $wwwextback = (int)($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinks"]);
- $wwwlan = $resjson["DataTables"]["Results"]["Data"][0]["Language"];
- $wwwlinks = round($resjson["DataTables"]["Results"]["Data"][1]["ExtBackLinks"], 0);
- $wwwdoms = round($resjson["DataTables"]["Results"]["Data"][1]["RefDomains"], 0);
- $wwwips = round($resjson["DataTables"]["Results"]["Data"][1]["RefIPs"], 0);
- $wwwcs = (int)($resjson["DataTables"]["Results"]["Data"][1]["RefSubNets"]);
- if ((($wwwtf > 0) && ($wwwtf / $tf > 0.5) && ($wwwdoms / $doms > 0.5)) || (($wwwtf > 0) && ($tf == 0))) {
- $allrd = $wwwrd;
- $allcu = $wwwcu;
- $allgov = $wwwgov;
- $alltf = $wwwtf;
- $allcf = $wwwcf;
- $extdom = $wwwextdom;
- $extback = $wwwextback;
- $alllan = $wwwlan;
- $alllinks = $wwwlinks;
- $alldoms = $wwwdoms;
- $allips = $wwwips;
- $allcs = $wwwcs;
- } else {
- $allrd = $rd;
- $allcu = $cu;
- $allgov = $gov;
- $alltf = $tf;
- $allcf = $cf;
- $allextdom = $extdom;
- $allextback = $extback;
- $alllan = $lan;
- $alllinks = $links;
- $alldoms = $doms;
- $allips = $ips;
- $allcs = $cs;
- }
- //echo '<br/>CF:'.$cf.'/'.$wwwcf.'('.$allcf.');TF:'.$tf.'/'.$wwwtf.'('.$alltf.');DOMS:'.$doms.'/'.$wwwdoms.'('.$alldoms.');LINKS:'.$links.'/'.$wwwlinks.'('.$alllinks.')<br/>IPS: '.$allips.'; CS: '.$allcs.'<br/>';
- flush();
- //echo '<br/>'.$d.';'.$allcf.';'.$alltf.';'.$alldoms.';'.$alllinks.';'.$allips.';'.$allcs;
- echo '<tr>';
- echo '<td>' . $row_index++ . '</td>';
- echo '<td><a href=https://www.google.com.ua/search?q=site:' . $d . ' class="c" target="_blank">' . $d . '</a></td>';
- echo '<td>' . $allrd . '</td>';
- //echo '<td><a href=https://www.google.com.ua/search?q=site:'.$d.' class="c" target="_blank">link</a></td>';
- echo '<td>' . $alltf . '</td>';
- echo '<td>' . $allcf . '</td>';
- echo '<td style="display:none;">' . $allextdom . '</td>';
- echo '<td style="display:none;">' . $allextback . '</td>';
- echo '<td>' . $tp1 . '</td>';
- echo '<td>' . $tp2 . '</td>';
- echo '<td style="display:none;">' . $tp3 . '</td>';
- echo '<td style="display:none;">' . $tp4 . '</td>';
- echo '<td style="display:none;">' . $allcu . '</td>';
- echo '<td style="display:none;">' . $allgov . '</td>';
- echo '<td style="display:none;">' . $alllan . '</td>';
- echo '<td>' . $alldoms . '</td>';
- echo '<td>' . $alllinks . '</td>';
- echo '<td style="display:none;">' . $allips . '</td>';
- echo '<td style="display:none;">' . $allcs . '</td>';
- 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>';
- echo '<td><a href="https://web.archive.org/web/*/' . $d . '" class="c" target="_blank">Archive</a></td>';
- echo '</tr>';
- } else {
- echo '<br/>' . $d . '<a style="color:red;">ERROR</a>';
- }
- }
- //print_r($rez);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement