<?php

// Define proxy settings
$proxy = 'tcp://172.17.0.2:3128'; // Replace with your proxy settings

// URL of the webpage
$url = 'https://games.evolution.com/slots/finn-and-the-candy-spin/';

// Create a context with the proxy
$context = stream_context_create([
    'http' => [
        'proxy' => $proxy,
        'request_fulluri' => true,
    ],
]);

// Fetch the HTML content of the webpage using the context
$html = file_get_contents($url, false, $context);

if ($html !== false) {
    // Search for the 'nonce' value within the HTML content
    if (preg_match('/var game_api_settings = {"nonce":"([^"]+)"/', $html, $matches)) {
        $nonceValue = $matches[1];
        echo $nonceValue;
    } else {
        echo "Nonce value not found.";
    }
} else {
    echo "Failed to fetch webpage content.";
}
?>
