【问题标题】:How to favourite Tweet using Twitter API如何使用 Twitter API 收藏推文
【发布时间】:2019-09-25 02:51:46
【问题描述】:

我正在使用 Abrahm 库 https://github.com/abraham/twitteroauth

我可以发布和转发,但试试这个代码收藏

$fav_tweets=$connection->post("favorites/create/id=835432351400357888");

$fav_tweets=$connection->post("favorites/create.json?id=835432351400357888");

$fav_tweets=$connection->post("favorites/create/835432351400357888");

但没有代码有效,它们返回结果:

stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [code] => 32 [message] => Could not authenticate you. ) ) ) 

请大家帮忙
提前致谢

【问题讨论】:

    标签: php api twitter


    【解决方案1】:

    https://twitteroauth.com/ 显示的示例中,尝试:

    $statues = $connection->post("favorites/create", ["id" => "835432351400357888"]);
    

    【讨论】:

      猜你喜欢
      • 2011-07-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-12
      • 1970-01-01
      • 2014-10-13
      • 1970-01-01
      相关资源
      最近更新 更多