Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme, fix rare bug #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ Login parameters:
- code: [string] email code for two-step verification (make sure to use string if your code starts with 0).

```php
use FUTApi\Api\Core;
use FUTApi\Exception\FutError;
use FUTApi\Api\Authentication\Account;
use FUTApi\Api\Authentication\Credentials;
use FUTApi\Api\Authentication\Session;
use FShapecode\FUT\Client\Api\Core;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this a typo? changeuse FShapecode\FUT\Client\Api\Core; to use Shapecode\FUT\Client\Api\Core;

use Shapecode\FUT\Client\Authentication\Credentials;
use Shapecode\FUT\Client\Authentication\Account;
use Shapecode\FUT\Client\Authentication\Session;

$credentials = new Credentials($email, $password, $platform);

Expand All @@ -64,8 +63,8 @@ $fut = new Core($account);
try {
$login = $fut->login($code);
$session = $account->getSession();
} catch(FutError $e) {
$reason = $e->getReason();
} catch(Exception $e) {
$reason = $e->getMessage();
die("We have an error logging in: ".$reason);
}
```
Expand All @@ -76,24 +75,23 @@ After you have initiated your first session, you can then use the API wthout log
### Search

Optional parameters:

- min_price: [int] Minimal price.
- max_price: [int] Maximum price.
- min_buy: [int] Minimal buy now price.
- max_buy: [int] Maximum buy now price.
- level: ['bronze'/'silver'/gold'] Card level.
- micr: [int] Minimal price.
- macr: [int] Maximum price.
- minb: [int] Minimal buy now price.
- maxb: [int] Maximum buy now price.
- lev: ['bronze'/'silver'/gold'] Card level.
- start: [int] Start page number.
- category: ['fitness'/'?'] Card category.
- type: ['fitness'/'player'/'?'] Card category.
- assetId: [int] assetId.
- defId: [int] defId.
- league: [int] League id.
- club: [int] Club id.
- position: [int?/str?] Position.
- leag: [int] League id.
- team: [int] Club id.
- pos: [str] Position. (e.g. "ST")
- zone: ['attacker'/'?'] zone.
- nationality: [int] Nation id.
- nat: [int] Nation id.
- rare: [boolean] True for searching special cards.
- playStyle: [str?] playStyle.
- page_size: [int] Amount of cards on single page (changing this might be risky).
- num: [int] Amount of cards on single page (changing this might be risky).

```php
$options = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Api/AbstractCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function login(?string $code = null) : array
'release_type' => 'prod',
'redirect_uri' => 'https://www.easports.com/fifa/ultimate-team/web-app/auth.html',
// 'redirect_uri' => 'nucleus:rest',
'scope' => 'basic.identity offline signin basic.entitlement',
//'scope' => 'basic.identity offline signin basic.entitlement',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you verify this by debugging the website?
At my last check this field was required.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't debug the website but this resolved the issues I had on my MacBook while not breaking anything on my PC. Let me know if this doesn't work for you!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would appreciate it if you would check this in the Chrome or Firefox debugger. Thank you very much.

],
'headers' => $headers,
'on_stats' => static function (TransferStats $stats) use (&$url) : void {
Expand Down