We now use the master branch of codebird

This commit is contained in:
Michael 2019-08-04 12:16:56 +00:00
parent 2e776253e0
commit 20ed3495b2
25 changed files with 992 additions and 1464 deletions

View file

@ -64,6 +64,7 @@
use Abraham\TwitterOAuth\TwitterOAuth;
use Abraham\TwitterOAuth\TwitterOAuthException;
use Codebird\Codebird;
use Friendica\App;
use Friendica\Content\OEmbed;
use Friendica\Content\Text\BBCode;
@ -591,6 +592,10 @@ function twitter_post_hook(App $a, array &$b)
return;
}
Codebird::setConsumerKey($ckey, $csecret);
$cb = Codebird::getInstance();
$cb->setToken($otoken, $osecret);
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);
// Set the timeout for upload to 30 seconds
@ -649,6 +654,7 @@ function twitter_post_hook(App $a, array &$b)
if (isset($media->media_id_string)) {
$post['media_ids'] = $media->media_id_string;
//$details = $cb->account_verifyCredentials();
} else {
throw new Exception('Failed upload of ' . $image);
}