twitteroauth
twitteroauth copied to clipboard
Batch up multiple requests in a single network call
I am using simultaneous HTTP requests in PHP with cURL to request multiple APIs in parallel.
I would like to get the options provided by the function request()
in order to input them somewhere else.
Is it possible to do that without changing the source?
If not, could we work on some solution to batch up several requests to be sent in a single network call like google does here: https://developers.google.com/api-client-library/php/guide/batch
Twitter doesn't support batching multiple requests together in a single connection like Google APIs does. The best that could be done would be to queue up several requests and make them in parallel. I haven't yet looked into how much work this would be to add.
Thanks for your answer Abraham.
Here comes my implementation of curl_multi_exec
for you
https://gist.github.com/rafasashi/ec8fa63155c1990e81f889cc3a053a0c
You can do GET or POST requests within the same call.
Let me know if I can help you.
TwitterOAuth is in maintenance mode and major improvements are no longer planned. https://github.com/abraham/twitteroauth/issues/1188