@@ 7-31 (lines=25) @@ | ||
4 | ||
5 | use PeeHaa\AsyncTwitter\Api\Request\BaseRequest; |
|
6 | ||
7 | class Ids extends BaseRequest |
|
8 | { |
|
9 | const METHOD = 'GET'; |
|
10 | ||
11 | const ENDPOINT = '/blocks/ids.json'; |
|
12 | ||
13 | public function __construct() |
|
14 | { |
|
15 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
16 | } |
|
17 | ||
18 | public function stringifyIds(): Ids |
|
19 | { |
|
20 | $this->parameters['stringify_ids'] = 'true'; |
|
21 | ||
22 | return $this; |
|
23 | } |
|
24 | ||
25 | public function fromCursor(int $cursor): Ids |
|
26 | { |
|
27 | $this->parameters['cursor'] = (string) $cursor; |
|
28 | ||
29 | return $this; |
|
30 | } |
|
31 | } |
|
32 |
@@ 7-30 (lines=24) @@ | ||
4 | ||
5 | use PeeHaa\AsyncTwitter\Api\Request\BaseRequest; |
|
6 | ||
7 | class Retweets extends BaseRequest |
|
8 | { |
|
9 | const METHOD = 'GET'; |
|
10 | const ENDPOINT = '/statuses/retweets/%d.json'; |
|
11 | ||
12 | public function __construct(int $id) |
|
13 | { |
|
14 | parent::__construct(self::METHOD, sprintf(self::ENDPOINT, $id)); |
|
15 | } |
|
16 | ||
17 | public function amount(int $amount): Retweets |
|
18 | { |
|
19 | $this->parameters['count'] = (string) $amount; |
|
20 | ||
21 | return $this; |
|
22 | } |
|
23 | ||
24 | public function trimUser(): Retweets |
|
25 | { |
|
26 | $this->parameters['trim_user'] = 'true'; |
|
27 | ||
28 | return $this; |
|
29 | } |
|
30 | } |
|
31 |
@@ 7-31 (lines=25) @@ | ||
4 | ||
5 | use PeeHaa\AsyncTwitter\Api\Request\BaseRequest; |
|
6 | ||
7 | class Lookup extends BaseRequest |
|
8 | { |
|
9 | const METHOD = 'GET'; |
|
10 | ||
11 | const ENDPOINT = '/friendships/lookup.json'; |
|
12 | ||
13 | public function __construct() |
|
14 | { |
|
15 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
16 | } |
|
17 | ||
18 | public function userIds(array $ids): Lookup |
|
19 | { |
|
20 | $this->parameters['user_id'] = implode(',', $ids); |
|
21 | ||
22 | return $this; |
|
23 | } |
|
24 | ||
25 | public function screenNames(array $screenNames): Lookup |
|
26 | { |
|
27 | $this->parameters['screen_name'] = implode(',', $screenNames); |
|
28 | ||
29 | return $this; |
|
30 | } |
|
31 | } |
|
32 |