PHP code example of fut / request-forge
1. Go to this page and download the library: Download fut/request-forge library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fut / request-forge example snippets
use GuzzleHttp\Client;
use GuzzleHttp\Cookie\CookieJar;
use GuzzleHttp\Subscriber\Cookie as CookieSubscriber;
use Fut\Request\Forge;
$client = new Client();
$cookieJar = new CookieJar();
$cookieSubscriber = new CookieSubscriber($cookieJar);
$client->getEmitter()->attach($cookieSubscriber);
$export = array(
'nucleusId' => 'my-nucleusId',
'sessionId' => 'my-sessionId',
'phishingToken' => 'my-phishingToken'
);
Forge::setPlatform(Forge::PLATFORM_PLAYSTATION);
Forge::setEndpoint(Forge::ENDPOINT_MOBILE);
// example for playstation accounts to get the credits
// 3. parameter of the forge factory is the actual real http method
// 4. parameter is the overridden method for the webapp headers
$forge = Forge::getForge($client, '/ut/game/fifa14/user/credits', 'post', 'get');
$json = $forge
->setNucId($export['nucleusId'])
->setSid($export['sessionId'])
->setPhishing($export['phishingToken'])
->getJson();
echo "you have " . $json['credits'] . " coins" . PHP_EOL;