Skip to content

Commit df362d8

Browse files
committed
Merge branch 'release/4.0.0-beta.1'
2 parents 100a8e8 + 1434ccc commit df362d8

19 files changed

+954
-1442
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ language: php
66
sudo: false
77

88
php:
9-
- "7.0"
10-
- "5.6"
11-
- "5.5"
9+
- "7.2"
10+
- "7.1"
1211
- hhvm
1312
- nightly
1413

CHANGELOG

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
codebird-php - changelog
22
========================
33

4+
4.0.0 (not yet released)
5+
+ #161 Update oembed API method endpoint
6+
+ Update to Twitter Ads API Version 1
7+
+ Add Ads API POST tailored_audience_memberships method
8+
+ Add Ads Sandbox API POST accounts method
9+
+ Add Ads Sandbox API POST accounts/:account_id/features method
10+
+ Add Ads Sandbox API POST accounts/:account_id/funding_instruments method
11+
+ Update more Ads API methods
12+
- Fix Ads API batch methods to send JSON body
13+
+ Update Ads API Analytics methods (stats)
14+
+ #177 Add async media/upload calls status by GET
15+
+ Add POST media/metadata/create method
16+
- Fix TON API upload - add additional header parsing
17+
+ Add custom Codebird Exception classes
18+
+ Add Account Activity API methods
19+
+ Add new Direct Messages API
20+
+ Update cacert.pem file
21+
- Remove sunsetting Direct Messages API
22+
- Remove sunsetting Streaming API
23+
- Remove contributor API methods
24+
- Remove deprecated statuses/update_with_media method
25+
- Remove deprecated statuses/update_profile_background_image method
26+
427
3.1.0 (2016-02-15)
528
+ #143 Add support for proxy types
629
+ #152 Throw Exception on failed remote media download

README.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
codebird-php
22
============
3-
*Easy access to the Twitter REST API, Collections API, Streaming API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.*
3+
*Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.*
44

5-
Copyright (C) 2010-2016 Jublo Solutions <support@jublo.net>
5+
Copyright (C) 2010-2018 Jublo Limited <support@jublo.net>
66

77
This program is free software: you can redistribute it and/or modify
88
it under the terms of the GNU General Public License as published by
@@ -17,12 +17,13 @@ GNU General Public License for more details.
1717
You should have received a copy of the GNU General Public License
1818
along with this program. If not, see <http://www.gnu.org/licenses/>.
1919

20+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3cd81a521d334648b9958327621a3070)](https://www.codacy.com/app/jublonet/codebird-php?utm_source=github.com&utm_medium=referral&utm_content=jublonet/codebird-php&utm_campaign=badger)
2021
[![Coverage Status](https://img.shields.io/coveralls/jublonet/codebird-php/develop.svg)](https://coveralls.io/github/jublonet/codebird-php?branch=develop)
2122
[![Travis Status](https://img.shields.io/travis/jublonet/codebird-php/develop.svg)](https://travis-ci.org/jublonet/codebird-php/branches)
2223

2324
### Requirements
2425

25-
- PHP 5.5.0 or higher
26+
- PHP 7.1.0 or higher
2627
- OpenSSL extension
2728

2829

@@ -131,6 +132,13 @@ In this case, you don't need to set the consumer key and secret.
131132
For sending an API request with app-only auth, see the ‘Usage examples’ section.
132133

133134

135+
### A word on your callback URL
136+
137+
Twitter is very restrictive about which URLs may be used for your callback URL.
138+
For example, even the presence of the ‘www’ subdomain must match with the domain
139+
that you specified in the settings of your app at https://developer.twitter.com/en/apps.
140+
141+
134142
Mapping API methods to Codebird function calls
135143
----------------------------------------------
136144

@@ -240,7 +248,7 @@ The library returns the response HTTP status code, so you can detect rate limits
240248
I suggest you to check if the ```$reply->httpstatus``` property is ```400```
241249
and check with the Twitter API to find out if you are currently being
242250
rate-limited.
243-
See the [Rate Limiting FAQ](https://dev.twitter.com/rest/public/rate-limiting)
251+
See the [Rate Limiting FAQ](https://developer.twitter.com/en/docs/basics/rate-limiting)
244252
for more information.
245253

246254
Unless your return format is JSON, you will receive rate-limiting details
@@ -325,7 +333,7 @@ print_r($reply);
325333
Here is a [sample Tweet](https://twitter.com/LarryMcTweet/status/475276535386365952)
326334
sent with the code above.
327335

328-
More [documentation for uploading media](https://dev.twitter.com/rest/public/uploading-media) is available on the Twitter Developer site.
336+
More [documentation for uploading media](https://developer.twitter.com/en/docs/media/upload-media/overview) is available on the Twitter Developer site.
329337

330338
### Remote files
331339

@@ -404,6 +412,9 @@ if ($reply->httpstatus < 200 || $reply->httpstatus > 299) {
404412
die();
405413
}
406414

415+
// if you have a field `processing_info` in the reply,
416+
// use the STATUS command to check if the video has finished processing.
417+
407418
// Now use the media_id in a Tweet
408419
$reply = $cb->statuses_update([
409420
'status' => 'Twitter now accepts video uploads.',
@@ -412,7 +423,7 @@ $reply = $cb->statuses_update([
412423

413424
```
414425

415-
**Find more information about [accepted video formats](https://dev.twitter.com/rest/public/uploading-media#videorecs) in the Twitter Developer docs.**
426+
**Find more information about [accepted media formats](https://developer.twitter.com/en/docs/media/upload-media/uploading-media/media-best-practices) in the Twitter Developer docs.**
416427

417428
:warning: When uploading a video in multiple chunks, you may run into an error `The validation of media ids failed.` even though the `media_id` is correct. This is known. Please check back in the [Twitter community forums](https://twittercommunity.com/tags/video).
418429

@@ -469,18 +480,22 @@ $cb->setStreamingCallback('some_callback');
469480
$GLOBALS['time_start'] = time();
470481

471482
// Second, start consuming the stream:
472-
$reply = $cb->user();
483+
$reply = $cb->statuses_filter();
473484

474485
// See the *Mapping API methods to Codebird function calls* section for method names.
475486
// $reply = $cb->statuses_filter('track=Windows');
476487
```
477488

478-
Find more information on the [Streaming API](https://dev.twitter.com/streaming/overview)
489+
You should be able to set a timeout for the streaming API using `setTimeout`.
490+
In addition, your callback will receive empty messages if no events occur,
491+
and you should make your function `return true;` in order to cancel the stream.
492+
493+
Find more information on the [Streaming API](https://developer.twitter.com/en/docs/tweets/filter-realtime/overview)
479494
in the developer documentation website.
480495

481496

482-
Twitter Collections API
483-
-----------------------
497+
Twitter Collections, Direct Messages and Account Activity APIs
498+
--------------------------------------------------------------
484499

485500
Collections are a type of timeline that you control and can be hand curated
486501
and/or programmed using an API.
@@ -490,12 +505,13 @@ often they will be decomposed, efficient objects with information about users,
490505
Tweets, and timelines grouped, simplified, and stripped of unnecessary repetition.
491506

492507
Never care about the OAuth signing specialities and the JSON POST body
493-
for POST collections/entries/curate.json. Codebird takes off the work for you
508+
for POST and PUT calls to these special APIs. Codebird takes off the work for you
494509
and will always send the correct Content-Type automatically.
495510

496-
Find out more about the [Collections API](https://dev.twitter.com/rest/collections/about) in the Twitter API docs.
511+
Find out more about the [Collections API](https://developer.twitter.com/en/docs/tweets/curate-a-collection/overview/about_collections) in the Twitter API docs.
512+
More information on the [Direct Messages API](https://developer.twitter.com/en/docs/direct-messages/api-features) and the [Account Activity API](https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/overview) is available there as well.
497513

498-
Here’s a sample for adding a Tweet using that API method:
514+
Here’s a sample for adding a Tweet using the Collections API:
499515

500516
```php
501517
$reply = $cb->collections_entries_curate([
@@ -511,7 +527,7 @@ var_dump($reply);
511527
TON (Twitter Object Nest) API
512528
-----------------------------
513529

514-
The [TON (Twitter Object Nest) API](https://dev.twitter.com/rest/ton) allows implementers to upload media and various assets to Twitter.
530+
The [TON (Twitter Object Nest) API](https://developer.twitter.com/en/docs/ads/audiences/overview/ton-upload.html) allows implementers to upload media and various assets to Twitter.
515531
The TON API supports non-resumable and resumable upload methods based on the size of the file.
516532
For files less than 64MB, non-resumable may be used. For files greater than or equal to 64MB,
517533
resumable must be used. Resumable uploads require chunk sizes of less than 64MB.
@@ -597,7 +613,7 @@ fclose($fp);
597613
Twitter Ads API
598614
---------------
599615

600-
The [Twitter Ads API](https://dev.twitter.com/ads/overview) allows partners to
616+
The [Twitter Ads API](https://developer.twitter.com/en/docs/ads/general/overview) allows partners to
601617
integrate with the Twitter advertising platform in their own advertising solutions.
602618
Selected partners have the ability to create custom tools to manage and execute
603619
Twitter Ad campaigns.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Joshua Atkins <joshua.atkins@jublo.net>",
77
"J.M. <jm@jublo.net>"
88
],
9-
"description": "Easy access to the Twitter REST API, Collections API, Streaming API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.",
9+
"description": "Easy access to the Twitter REST, Direct Messages, Account Activity, TON (Object Nest) and Twitter Ads API — all from one PHP library.",
1010
"main": "src/codebird.php",
1111
"moduleType": [],
1212
"keywords": [

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jublonet/codebird-php",
3-
"description" : "Easy access to the Twitter REST API, Collections API, Streaming API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.",
3+
"description" : "Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.",
44
"keywords": [
55
"Twitter",
66
"API",
@@ -38,8 +38,8 @@
3838
"classmap": ["src/"]
3939
},
4040
"require-dev": {
41-
"satooshi/php-coveralls": ">=0.6",
42-
"phpunit/phpunit": ">=3.7",
41+
"php-coveralls/php-coveralls": ">=0.6",
42+
"phpunit/phpunit": ">=7.3",
4343
"squizlabs/php_codesniffer": "2.*"
4444
}
4545
}

0 commit comments

Comments
 (0)