HEX
Server: Apache
System: Linux digivps 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: root (0)
PHP: 8.3.15
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/healthyton.com/wp-scrap/corona_v1.php
<?php
require 'vendor/autoload.php';
use Goutte\Client;
$url = 'https://www.worldometers.info/coronavirus/';
$client = new Client();
$crawler = $client->request('GET', $url);
$result = array();
$i = 0;
$row_number=0;
$name = $crawler->filter('table#main_table_countries_today tbody tr')->each(function($node) use (&$result, &$i, &$row_number) {
    $count = 0;
    $end = false;
    $skip = false;
    if($row_number != 0){
        $node->filter('td')->each(function($nodeChild) use(&$count, &$result, &$i, &$skip,&$row_number){
            if($nodeChild->text() == 'Total:'){
                $skip = true;
            }
            $skipArr = array(
                'Europe','Asia','South America','Oceania','Africa',''
            );
            if($count == 1 && in_array(trim($nodeChild->text()), $skipArr)){
                $skip = true;
            }
            if($count == 1 && empty(trim($nodeChild->text()))){
                $skip = true;
            }

            if(!$skip){
                if($count == 1){
                    $result[$i]['country'] = trim($nodeChild->text());
                }else if($count == 2){
                    $result[$i]['confirmed'] = (int)str_replace(",","",$nodeChild->text());
                }else if($count == 4){
                    $result[$i]['deaths'] = (int)str_replace(",","",$nodeChild->text());
                }else if($count == 6){
                    $result[$i]['recovered'] = (int)str_replace(",","",$nodeChild->text());
                }
            }
           $count++;
        });
        $i++;
    }
    $row_number++;
});

$result = array_values($result);

header('Content-Type: application/json');
echo json_encode($result);