fut / request-forge
Fifa Ultimate Team 请求锻造。
v2.0.2
2014-08-07 19:19 UTC
Requires
- guzzlehttp/guzzle: 4.1.*
This package is auto-updated.
Last update: 2024-08-29 03:47:37 UTC
README
Fifa 14 Ultimate Team 移动端点的连接器类。您也可以使用composer安装连接器
composer.json
require { "fut/request-forge": "dev-master" }
示例:(也见example.php)
require_once __DIR__ . "/vendor/autoload.php"; 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;