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/spinbot_get_heightline.php
<?php
require 'vendor/autoload.php';
use Goutte\Client;

function strip_tags_blacklist($html, $tags) {
    $html = preg_replace('/<'. $tags .'\b[^>]*>(.*?)<\/'. $tags .'>/is', "", $html);
    return $html;
}

$url = 'https://heightline.com/ariana-grande-height-weight-dress-and-shoe-size/';
if(isset($_GET['url'])){
    $url = $_GET['url'];
}

$client = new Client();
$crawler = $client->request('GET', $url);
$name = array_shift($crawler->filter('h1.tdb-title-text')->extract('_text'));

try{
    $image = $crawler->filterXpath('//meta[@property="og:image"]')->attr('content');
}catch (Exception $e){
    $image = '';
}
$category = array_shift($crawler->filter('a.tdb-entry-category')->extract('_text'));

$html = $crawler->filter('div.tdb_single_content')->html();

$html = preg_replace('/(<(script|style)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $html);
$strip_tags = "center|style|span|ins|div|script|a|img|input|button|figure";
// remove link
$html = preg_replace('#<a.*?>.*?</a>#i', '', $html);
$html = str_replace('See Also:','',$html);
$html = str_replace('Read Also:','',$html);

//$html = str_replace('\n','',$html);
$html = preg_replace("#<\s*\/?(".$strip_tags.")\s*[^>]*?>#im", '', $html);

$strip_tags = "figcaption";
/*$html = preg_replace("#<\s*\/?(".$strip_tags.")\s*[^>]*?>#im", '', $html);*/
$html = preg_replace('/(<(figcaption)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $html);
$html = preg_replace('/<figcaption[^>]*>([\s\S]*?)<\/figcaption[^>]*>/', '', $html);

// Remove empty paragraphs
$html = str_replace("<strong> </strong>","",$html);
$html = str_replace("<p></p>","",$html);
$html = trim($html);
$textToSpin = str_replace('</div>','',$html);


$url = 'https://api.spinbot.com';
$header = array();
$spinbotApiKey = '87b0d1bb9b3c420381ee141837cbc7f5';
$header[] = "x-auth-key:$spinbotApiKey";

// optional header values
$header[] = 'x-spin-cap-words:true';
$header[] = 'x-words-to-skip:rewrit,nonExistentWordPart';
$header[] = 'x-min-percent-change-per-sentence:any';

// Execute cURL request, get response
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $textToSpin);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$response = curl_exec($ch);
curl_close($ch);

//echo $response;exit;

// Make the response readable
list($strResponseHeaders, $strResponseBody) = explode("\r\n\r\n", $response, 2);
list($strResponseHeaders, $strResponseBody) = explode("\r\n\r\n", $strResponseBody, 2);
$aHeaders = putHeadersTextIntoArray($strResponseHeaders);

//echo $strResponseHeaders;
//print_r($aHeaders);
//echo $strResponseBody;exit;

//$out = substr(strstr($strResponseBody, '<p>'), strlen('<p>'));
//echo $out;exit;
$fields['name'] = trim($name);
$fields['image'] = $image;
$fields['category'] = $category;
$fields['body'] = $strResponseBody;
$fields['available-spins'] = $aHeaders['available-spins'];

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

function putHeadersTextIntoArray($header_text) {
    $headers = array();
    foreach (explode("\r\n", $header_text) as $i => $line)
        if ($i === 0) {
            $headers['http_code'] = $line;
        } else {
            list ($key, $value) = explode(': ', $line);
            $headers[$key] = $value;
        }
    return $headers;
}
?>