- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
请原谅这个 super 精确的问题,但我在这方面还很陌生,需要一些帮助。在我遇到这个障碍之前,我以为我已经理解了一切。
我正在使用 9lesson's Instagram PHP Oauth tutorial ,它建立在 cosenary 的 Instagram PHP API 类之上。
一切都在正常运行,但我正在尝试添加一行来显示登录用户他们有多少关注者。
我添加了第三行,复制了已经存在的前两行。
echo '<b>Profile Pic:</b> '.$data->user->profile_picture.'</br>';
echo '<b>Access Token:</b> '.$data->access_token.'</br>';
echo '<b>Followed by</b> '.$data->user->counts->followed_by.'</br></div>';
我在 $_SESSION['userdetails']=$data;
下添加了最后一行
$followers =$data->user->counts->followed_by;
为什么这不会返回任何数据,即使它是端点的正确名称?我觉得我已经尝试了 10 种可能的组合。任何帮助都会很棒!
最佳答案
我查看了您正在使用的 Instagram API。
看起来你正在从这个调用中获取 $data
$data = $instagram->getOAuthToken($code);
此调用旨在获取访问 token 并调用此端点
https://api.instagram.com/oauth/access_token
如果您查看 Instagram API你会看到这个调用没有返回任何计数
{
"access_token": "fb2e77d.47a0479900504cb3ab4a1f626d174d2d",
"user": {
"id": "1574083",
"username": "snoopdogg",
"full_name": "Snoop Dogg",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1574083_75sq_1295469061.jpg"
}
}
使用他的 API,我不确定如何获得计数。我建了一个 API (需要 php 5.3+)使其 super 简单。
$current_user = $instagram->getCurrentUser();
$followers = $current_user->getFollowers(); //get first page of followers
$followers_count = $current_user->getFollowersCount(); //get number of followers
举个例子
http://galengrover.com/projects/instagram/?example=current_user.php
关于php - 显示来自 Instagram PHP API 的用户信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14542691/
我想获取该用户所关注的 Instagram 用户列表。(但不是为我自己,为另一个用户)。 我做 API 调用 GET https://api.instagram.com/v1/users/423423
我提到过这个问题Instagram API: The access_token provided is invalid ,在我自己发布这个问题之前。 我的情况非常相似,我昨天刚刚注册了一个新应用程序,
Instagram 宣布弃用 Instagram 平台 API: “为了不断提高 Instagram 用户的隐私和安全,我们正在加速弃用 Instagram API 平台” 他们的文档和变更日志表示要
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 已关闭 3 年前。 Improve
我正在发送多条 Instagram 直接消息,并希望预先填充在我和我的关注者之间打开直接消息的 URL。我有每个粉丝的 Instagram ID 和用户名。 目前,Instagram 的“收件箱”地址
我正在做一个 Instagram 应用程序。首先想使用 Instagram 的端点。但是很多功能都被关闭了。用户搜索、关注者、关注列表等。 Instagram 宣布将于 7 月 31 日关闭许多 En
- (IBAction)postToInstagram:(id)sender { NSURL *instagramURL = [NSURL URLWithString:@"instagram://ap
我正在尝试创建一个程序,从 Instagram 帐户中检索喜欢、评论等的总数,不一定是评论的内容等,而只是给出特定帐户的喜欢和评论总数。这可能使用 Instagram API 吗? 最佳答案 所以我一
目前我使用 /users/self/media/liked方法,获取响应,阅读 next_max_like_id并一次又一次地请求数据。我试图通过巨大的 count值,但看起来最大计数值只是 30 .
我阅读了 instargam API 并在谷歌中搜索了代码,但没有得到满足我要求的任何确切解决方案。我想像 Facebook 插件一样在我的网站上显示我最近的照片。我的图像看起来像 - 我尝试了以下
我只是想知道是否有办法在 instagram 上获取用户的性别......我浏览了 instagram 的 api 并且从 users/userId 获得的用户信息不包括性别信息。 谢谢你的帮助。 最
假设我有一个 Instagram 帐户和一个网站。我想在网站上显示来自我的 Instagram 帐户的最新照片。我在文档中不清楚的东西:为了得到我的 access_token我需要验证自己的身份吗?我
我正在使用以下查询https://www.instagram.com/graphql/query/?query_id=17851374694183129&id={acountId}&first=100
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我试图让我的应用程序能够使用除基本权限之外的其他范围,但是当我尝试使用其他范围时,我收到以下错误: Something went wrong :(stdClass Object ( [meta] =>
我正在尝试注册新 Client ID在 Instagram 上,用于提供 API。 但是不知道怎么填Privacy Policy URL .请指导我。 最佳答案 这是格式 @ http://www.g
我有一个显示我的 Instagram 动态的网站。以前我在用Instagram 遵循 API。用户/ self /媒体/最近 此 API 使用我生成一次的访问 token ,并在我的代码中作为变量保存
最近 Instagram 宣布支持多张照片发布。 我尝试使用端点,GET /media/media-id ,但响应只有一张图像的信息。 任何人都可以使用他们的 API 从单个多张照片帖子中检索所有图像
我想检查 Instagram 用户名是否以“正确”的方式可用。目前我正在做的是打开想要的用户名他们的 instagram 页面并检查状态代码是否为 404。但这会带来一个问题,因为如果名称的前一个所有
我正在考虑使用 insta API 的项目,但是当我注册 instagramdeveloper 帐户时,我遇到了一些问题。我找不到创建新客户端的按钮,当我点击管理客户端按钮时,这就是我得到的: 当我点
我是一名优秀的程序员,十分优秀!