twitteroauth
twitteroauth copied to clipboard
Support additional API hosts
Twitter has since added a number of additional hosts that are used and they need to be supported.
A potential design could look something like this:
$twitteroauth->subdomain('version').method('path', params);
$t->api->get(...); // https://api.twitter.com/1.1
$t->api('1.1')->get(...); // https://api.twitter.com/1.1
$t->api('labs/1')->get(...); // https://api.twitter.com/labs/1
$t->dataApi->post(...); // https://data-api.twitter.com
$t->upload->post(...); // https://upload.twitter.com
$t->adsApi->post(...); // https://ads-api.twitter.com/7
$t->gnipApi->post(...); // https://ads-api.twitter.com
$t->oauth->get(...); // https://oauth.twitter.com
$t->ton->get(...); // https://oauth.twitter.com
$t->stream->get(...); // https://stream.twitter.com
$t->gnipStream->get(...); // https://gnip-stream.twitter.com
Methods to support
- GET
- POST
- DELETE
- PUT
Authentication to support
- oauth 1
- oauth 2
- basic auth
Payload types to support
- json
- html form
- media
TODO:
- [ ] Audit Twitter docs for all the hosts that need to be tested.
Hello Abraham,
Thanks a lot for your effort for adding additional hosts. I want data-api.twitter.com for impression count, so may I know when we got the updated package.
Thanks
This will be great! When we can have this?
It's not officially supported but you can override apiUrl in 3.1.0 and later which will allow custom API hosts.
TwitterOAuth is in maintenance mode and major improvements are no longer planned. https://github.com/abraham/twitteroauth/issues/1188