shapecode / fut-api
此包已被废弃,不再维护。未建议替换包。
FIFA WebApp API
19.0.0
2019-06-26 13:37 UTC
Requires
- php: ~7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.3
- php-http/client-common: ^2.0
- php-http/discovery: ^1.4
- php-http/guzzle6-adapter: ^2.0
- php-http/httplug: ^2.0
- php-http/logger-plugin: ^2.0
- php-http/message: ^1.7
- php-http/message-factory: ^1.0
- php-http/stopwatch-plugin: ^2.0
- psr/http-message: ^1.0
- psr/log: ^1.0
- shapecode/anticaptcha: ^1.0
- symfony/property-access: ^2.8|^3.0|^4.0
- symfony/stopwatch: ^2.8|^3.0|^4.0
- symfony/translation: ^2.8|^3.0|^4.0
- symfony/yaml: ^2.8|^3.0|^4.0
This package is auto-updated.
Last update: 2023-12-03 12:20:28 UTC
README
使用此FIFA 20 Ultimate Team API管理您的FIFA 20 Ultimate Team。完全使用PHP编写。
安装
推荐通过Composer安装FIFA 20 WebApp API。
composer require shapecode/fut-api "~20.0@dev"
贡献
不要害羞。请随时贡献并创建pull请求。有很多事情要做。
用法
登录
登录参数
- email: [string] 用于登录FIFA 20 WebApp的电子邮件
- password: [string] 用于登录FIFA 20 WebApp的密码
- platform: [string] pc/ps4/ps4/xbox/xbox360
- code: [string] 双重验证的电子邮件代码(如果您的代码以0开头,请确保使用字符串)。
use FUTApi\Api\Core; use FUTApi\Exception\FutError; use FUTApi\Api\Authentication\Account; use FUTApi\Api\Authentication\Credentials; use FUTApi\Api\Authentication\Session; $credentials = new Credentials($email, $password, $platform); // if you already have a valid session $session = new Session($persona, $nucleus, $phishing, $session, $dob, $accessToken, $tokenType); // otherwise $session = null; $account = new Account($credentials, $session); $fut = new Core($account); try { $login = $fut->login($code); $session = $account->getSession(); } catch(FutError $e) { $reason = $e->getReason(); die("We have an error logging in: ".$reason); }
您启动了第一次会话后,可以使用会话信息使用API,而无需再次登录。
搜索
可选参数
- min_price: [int] 最小价格。
- max_price: [int] 最大价格。
- min_buy: [int] 最小购买价格。
- max_buy: [int] 最大购买价格。
- level: ['bronze'/'silver'/gold'] 卡牌等级。
- start: [int] 开始页码。
- category: ['fitness'/'?'] 卡牌类别。
- assetId: [int] 资产ID。
- defId: [int] defId。
- league: [int] 联盟ID。
- club: [int] 俱乐部ID。
- position: [int?/str?] 位置。
- zone: ['attacker'/'?'] 区域。
- nationality: [int] 国籍ID。
- rare: [boolean] 搜索特殊卡牌时为真。
- playStyle: [str?] 玩家风格。
- page_size: [int] 单页卡牌数量(更改此参数可能存在风险)。
$options = []; $items = $fut->search($options);
登出
模拟点击登出按钮。
$fut->logout();
许可证
GNU GPLv3