403Webshell
Server IP : 51.89.169.208  /  Your IP : 3.145.40.61
Web Server : Apache
System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64
User : yellowleaf ( 1019)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/yellowleaf/public_html/api/v1/business/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yellowleaf/public_html/api/v1/business/BACKUP_download-logos.php
<?php
include_once $_SERVER["DOCUMENT_ROOT"]."/connect_db.php";
set_time_limit(600);

// $connect->query("UPDATE ads SET `logo_scrapped` = 0, `scrapped_status` = ''") || die("Error: ".$connect->error);
// die("done");

// $se = $connect->query("SELECT * FROM `ads` WHERE `logo_scrapped` = 0 AND `scrapped_status` = ''");
// echo "Total business: ".$se->num_rows."<br>";
// die();

$res = $connect->query("SELECT COUNT(*) FROM `ads` WHERE `active` = 1 AND `logo_scrapped` = -1");
$row = $res->fetch_row();
$total = $row[0];
echo "Total active business: ".$total."<br>";
die();

$res_logos = $connect->query("SELECT * FROM `businesses_scraped_logo` WHERE `done` = 0");
echo "Total scrapped logo: ".$res_logos->num_rows."<br>";

$res = $connect->query("SELECT COUNT(*) FROM ads WHERE active = 1 AND image = ''");
$res2 = $connect->query("SELECT COUNT(*) FROM ads WHERE active = 1 AND image = '' AND url = ''");
$row = $res->fetch_row();
$row2 = $res2->fetch_row();
$total = $row[0];
echo "Total business where don't have logo: ".$total."<br>";
echo "Total business where don't have logo and url: ".$row2[0]."<br>";

// $res = $connect->query("SELECT adid, url, image FROM ads WHERE active = 1 AND image = '' LIMIT 100");

// // echo "Row count: ".$res->num_rows."<br>";
// // fetch all
// $businesses = array();
// $invalid_url_count = 0;
// while($row = $res->fetch_assoc()) {
//     // array_push($businesses, $row);
//     $url = $row['url'];
//     if (substr($url, 0, 7) != 'http://' && substr($url, 0, 8) != 'https://') {
//         $url = 'https://'.$url;
//     }
//     $is_valid_web = 0;
//     $headers = @get_headers($url);
//     // echo "First url: $url <br>";
//     if ($headers) {
//         $is_valid_web = 1;
//     }else{
//         if (substr($url, 0, 7) == 'http://') {
//             // echo "on http <br>";
//             $url = str_replace('http://', 'https://', $url);
//         }else if (substr($url, 0, 8) == 'https://') {
//             // echo "on https <br>";
//             $url = str_replace('https://', 'http://', $url);
//         }

//         $headers = @get_headers($url);
//         if ($headers) {
//             $is_valid_web = 1;
//         }
//     }
// if (!$is_valid_web) {
//     $invalid_url_count++;
//     echo "<span style='color: red;'>Invalid url: $url </span><br>";
// }else{
//     echo "<span style='color: green;'>Valid url: $url </span><br>";
// }
// }

// echo "Total invalid url: $invalid_url_count <br>";

// echo "<pre>";
// print_r($businesses);



?>

Youez - 2016 - github.com/yon3zu
LinuXploit