mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-11 19:08:49 +00:00
We now use the master branch of codebird
This commit is contained in:
parent
2e776253e0
commit
20ed3495b2
25 changed files with 992 additions and 1464 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue