dpdhnd3577 2016-05-03 13:32
浏览 34

为什么我不能使用codebird自动发布到Twitter?

I would like to reach this in steps:

-Upload a video to youtube using php and Youtube API v3

-After the video is uploaded, I wold like to auto post the video link and video title to the twitter, using codebird libery.

What I have at this time:

require_once ('codebird.php');
\Codebird\Codebird::setConsumerKey('YOURKEY', 'YOURSECRET'); // static, see README

$cb = \Codebird\Codebird::getInstance();
$cb->setToken('YOURTOKEN', 'YOURTOKENSECRET');
// Call set_include_path() as needed to point to your client library.
require_once 'Google/autoload.php';
require_once 'Google/Client.php';
require_once 'Google/Service/YouTube.php';
session_start();
set_time_limit(0);
//More code for youtube uploading.............

// The point varibles:
htmlBody .= "<h3>Video Uploaded</h3><ul>";


    $htmlBody .= sprintf('<li>%s (%s)</li>',
        $status['snippet']['title'],
        $status['id']);

Post to twitter:

$params = array(
    'status' =>"https://www.youtube.com/watch?v=".$status['id'], $status['snippet']['title'],
     );
     $reply = $cb->statuses_update($params);

And the erorr is what I get in the page:

An client error occurred: The OAuth 2.0 access token has expired, and a refresh token is not available. Refresh tokens are not returned for responses that were auto-approved.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?