| Server IP : 138.197.107.151 / Your IP : 216.73.217.7 Web Server : Apache/2.4.58 (Ubuntu) System : Linux BloxBy-Builder 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : wpbetasites_mrakzqskir ( 1022) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/shark/app/Http/Controllers/ |
Upload File : |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class MShotsController extends Controller
{
public function check(Request $request)
{
$targetUrl = $request->query('url');
if (!$targetUrl) {
return response()->json(['status' => 'error', 'message' => 'URL missing'], 400);
}
$mshotsUrl = "https://s.wordpress.com/mshots/v1/" . urlencode($targetUrl) . "?w=1600&h=900";
$ch = curl_init($mshotsUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true); // HEAD request
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); // detect redirects
// Set browser-like headers
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: image/webp,image/apng,image/*,*/*;q=0.8',
'Accept-Language: en-US,en;q=0.9'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$redirect = curl_getinfo($ch, CURLINFO_REDIRECT_URL);
curl_close($ch);
return response()->json([
'http_code' => $httpCode,
'redirect' => $redirect ?? null,
'valid' => $httpCode === 200 && !$redirect
]);
}
}