Releases: zendframework/ZendService_Twitter
ZendService_Twitter 3.0.4
Added
- #58 adds support for PHP 7.3.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
ZendService_Twitter 3.0.3
Added
- Nothing.
Changed
- #57 adds awareness of the
tweet_mode=extendedparameter to each of
the home, mentions, and user timeline API endpoint methods.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
zendservice-twitter 3.0.2
Added
- #55 adds support for 280-character tweets.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
-
#53 fixes issues in the majority of POST endpoints. Due to a mis-read of the Twitter API documentation, we were sending JSON payloads, when only a small subset of such endpoints actually can accept JSON. In particular,
statuses/updatewas affected. The patch in this releases fixes all such endpoints. -
#52 fixes the
search/tweetslogic concerning geocode parameter validation, ensuring it no longer raises an exception for a valid geocode parameter. -
#51 fixes submission of direct messages to the Twitter API. Payloads for DMs have been broken since the 3.0.0 release.
zendservice-twitter 3.0.1
Added
-
#46 adds the method
listsMembers(), for retrieving a list of Twitter users associated with a given list. The signature is:public function listMembers( int|string $listOrSlug, array $params = [] ) : Response
If
$listOrSlugis a list identifier, no additional$paramsare required. If it is a string list slug, then one of the following$paramsMUST be present:owner_id: a valid user identifier (integer)owner_screen_name: a valid user screen name (string)
-
#45 adds the ability to pass arrays of user identifiers OR screen names to each of the
usersLookup()andfriendshipsLookup()methods, giving them parity with the Twitter API. In each case, if you pass an array of values, the MUST be all user identifiers OR user screen names; you cannot mix the types.
Changed
- Nothing.
Deprecated
- Nothing.
Removed
- Nothing.
Fixed
- Nothing.
zendservice-twitter 3.0.0
Added
-
#39 adds support for PHP 7.1 and PHP 7.2.
-
#34 adds support for uploading media, via the new classes
ZendService\Twitter\Media,Image, andVideo. In each case, instantiate the appropriate class with the path to the image on the filesystem and the appropriate media type, and then callupload()with a zend-http client. The response will contain amedia_idproperty, which you can then provide via themedia_idsattribute when posting a status.$image = new Image('data/logo.png', 'image/png'); $response = $image->upload($client); $twitter->statusUpdate( 'A post with an image', null, ['media_ids' => [$response->media_id]] );
-
#42 adds support for attaching media to direct messages. To do so, first upload an image, marking the image for a direct message; you can also optionally mark it to share, in which case you can re-use the returned media identifier with multiple direct messages:
$image = new Image( 'data/logo.png', 'image/png', $forDirectMessage = true, $shared = false ); $upload = $image->upload($client);
Once you have the media identifier, you can provide it via an extra parameter to the
directMessagesNew()method, or the newdirectMessagesEventNew()method (which more closely corresponds to the API endpoint):$twitter->directmessagesEventsNew( $user, $message, ['media_id' => $upload->id_str] );
Direct messages only support one attachment at a time.
-
#37 and #43 add support for returning media entities when calling
statusesShow(). The method now allows a second, optional argument,$options, which may contain the following keys to pass to the Twitter API:tweet_mode; if present, it will be passed as the valueextended.include_entitiestrim_userinclude_my_retweet
-
#34 adds support for Twitter's rate limit headers. Returned responses allow you to query them via
getRateLimit(), and the returnedZendService\Twitter\RateLimitinstance allows you to check the limit, remaining requests, and time to reset.$response = $twitter->statusUpdate('A post'); $rateLimit = $response->getRateLimit(); if ($rateLimit->remaining === 0) { // Time to back off! sleep($rateLimit->reset); // seconds left until reset }
-
#29 adds support for:
- retrieving a list of follower identifiers (
/followers/idsAPI) - retrieving the lists to which the user belongs (
/lists/membershipsAPI) - retrieving the friends of the user (
/friendships/lookupAPI) - retrieving full user data on a list of users (
/users/lookupAPI) - retrieving the identifiers for friends of the user (
/friends/idsAPI)
- retrieving a list of follower identifiers (
-
#31 adds support for PHP 7.
Changed
-
#44 modifies the visibility of both
get()andpost()to make them public; additionally, each also now initializes the request, and returns aZendService\Twitter\Responseinstance, allowing them to be used to access API endpoints not yet directly supported in theTwitterclass. As examples:// Retrieve a list of friends for a user: $response = $twitter->get('friends/list', ['screen_name' => 'zfdevteam']); foreach ($response->users as $user) { printf("- %s (%s)\n", $user->name, $user->screen_name); } // Add a tweet to a collection: $response = $twitter->post('collections/entries/add', [ 'id' => $collectionId, 'tweet_id' => $statusId, ]); if ($response->isError()) { echo "Error adding tweet to collection:\n"; foreach ($response->response->errors as $error) { printf("- %s: %s\n", $error->change->tweet_id, $error->reason); } }
-
#41 modifies how the
Twitterclass sendsPOSTrequests to send JSON payloads instead ofapplication/x-www-form-urlencoded. All payloads except those for media uploads support this, and several newer endpoints (such as methods for allowing direct message media attachments) now require them. -
#40 updates direct message support to set the character limit to 10k, as documented currently for the Twitter API.
-
#34 updates the
Twitterclass to return aZendService\Twitter\Responseinstance instead of a zend-http response instance. This allows auto-parsing of the returned JSON response, as well as access to rate limit information.
Deprecated
- Nothing.
Removed
- #39 removes support for PHP versions less than 7.1.
Fixed
- Nothing.