Adapter.php
1 month ago
CtfOauthConnect.php
1 month ago
MediaAdapter.php
1 month ago
TweetAdapter.php
1 month ago
TwitterHelperApi.php
1 month ago
UserAdapter.php
1 month ago
UserAdapter.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Class for converting user sub attribute from Twitter API v1.1 to v2. |
| 5 | * |
| 6 | * @package twitter-api-v2 |
| 7 | */ |
| 8 | |
| 9 | namespace TwitterFeed\V2; |
| 10 | |
| 11 | // Don't load directly. |
| 12 | if (! defined('ABSPATH')) { |
| 13 | die('-1'); |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * UserAdapter class. |
| 18 | */ |
| 19 | class UserAdapter extends Adapter { |
| 20 | |
| 21 | /** |
| 22 | * Get mapped fields. |
| 23 | * |
| 24 | * @return array |
| 25 | */ |
| 26 | public function getMappedFields() |
| 27 | { |
| 28 | return [ |
| 29 | 'screen_name' => 'username', |
| 30 | 'profile_image_url_https' => 'profile_image_url', |
| 31 | 'followers_count' => [ 'public_metrics', 'followers_count' ], |
| 32 | 'statuses_count' => [ 'public_metrics', 'tweet_count' ], |
| 33 | 'utc_offset' => '', |
| 34 | ]; |
| 35 | } |
| 36 | } |
| 37 |