Skip to content

Commit

Permalink
correct set request query params and add Guzzle documentation link
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Jul 27, 2017
1 parent c6c18f9 commit 095c9df
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,20 @@ $content = $browser->get('translations');
Last translations for ongoings:

```php
$content = $browser->get('translations', ['feed' => 'recent']);
$content = $browser->get('translations?feed=recent');
```

List of all translations (at the beginning of the oldest, convenient for a full scan):

```php
$content = $browser->get('translations', ['feed' => 'id']);
$content = $browser->get('translations?feed=id');
```

When scanning in full, do not use the `offset` parameter. Use `afterId` (offset works very slowly when the account goes
to hundreds of thousands of translations):

```php
$content = $browser->get('translations', ['feed' => 'id', 'afterId' => 10000]);
$content = $browser->get('translations?feed=id&afterId=10000');
```

One translation:
Expand All @@ -106,25 +106,25 @@ $content = $browser->get('series');
You can select only specific fields:

```php
$content = $browser->get('series', ['fields' => 'id,title,typeTitle,posterUrlSmall']);
$content = $browser->get('series?fields=id,title,typeTitle,posterUrlSmall');
```

Advanced filter as on the [site](https://smotret-anime.ru/catalog/filter/genre@=8,35;genre_op=and):

```php
$content = $browser->get('series', ['chips' => 'genre@=8,35;genre_op=and']);
$content = $browser->get('series?chips=genre@=8,35;genre_op=and');
```

You can filter by parameters:

```php
$content = $browser->get('series', ['myAnimeListId' => 24133]);
$content = $browser->get('series?myAnimeListId=24133');
```

Search by name:

```php
$content = $browser->get('series', ['query' => 'gate']);
$content = $browser->get('series?query=gate');
```

Information about a specific anime and a list of episodes:
Expand All @@ -146,9 +146,13 @@ $content = $browser->get('episodes/102173');
Through `limit` and `offset`, you can adjust the number of elements "on the page" and the offset from the beginning:

```php
$content = $browser->get('series', ['limit' => 1, 'offset' => 10]);
$content = $browser->get('series?limit=1&offset=10');
```

### Request options

You can customize request options. See [Guzzle Documentation](http://docs.guzzlephp.org/en/stable/request-options.html).

License
-------

Expand Down

0 comments on commit 095c9df

Please sign in to comment.