does abraham's twitteroauth library work for update_with_media?

时光毁灭记忆、已成空白 提交于 2019-12-04 16:41:52

Yes it does! Change the two files Oauth.php and twitteroauth.php as the described at this link https://github.com/robhaswell/twitteroauth/commit/7f5bfd2450cb1cff71641d7ea55e118f5a42885d and use $connection->upload method like this.

 $params = array('media[]' => '@'.$image_url, 'status' => $messafe);
 $twit = $connection->upload('statuses/update_with_media',$params);
StrayObject

As per library author answer elsewhere - No it does not work with update_with_media yet.

TwitterOAuth does not currently support media uploads. I hope to add support in the future. on 10th of May by @abraham at update_with_media using abraham's twitteroauth

 $params = array('media[]' => file_get_contents($image_url), 'status' => $messafe);
 $twit = $connection->upload('statuses/update_with_media',$params);

A little change if update_with_media is not working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!