【问题标题】:get a list of suggested people on twitter from twitteroauth in php从 php 中的 twitteroauth 获取 twitter 上的建议人员列表
【发布时间】:2018-03-26 01:08:40
【问题描述】:

我有以下代码,我试图从中获取用户。我正在使用从 twitteroauth.com 获得的 twitteroauth 这是我的代码

require "twitteroauth/autoload.php";

use Abraham\TwitterOAuth\TwitterOAuth;

$connection = new TwitterOAuth("xxxxx", "xxxxx", "xxxxxxx", "xxxxxxx");

$content = $connection->get("account/verify_credentials");

$users = $connection->get("users/suggestions/:slug", ["slug"=>"sports"]);

print_r($users);

我收到以下错误:

stdClass Object
(
    [errors] => Array
        (
            [0] => stdClass Object
                (
                    [code] => 34
                    [message] => Sorry, that page does not exist.
                )

        )

)

我做错了什么?我在 twitter 开发页面上阅读了文档 https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-users-suggestions-slug

提前感谢您的帮助

【问题讨论】:

    标签: php curl twitter oauth twitter-oauth


    【解决方案1】:

    我找到了解决办法

    :slug 是放置值的占位符。您需要以下之一:

    $connection->get("users/suggestions/sports");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-03
      • 2014-06-23
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 2014-07-03
      • 2013-03-30
      相关资源
      最近更新 更多