Please help me out here, i am a noob going nuts on Facebook API calls...
I want to retrieve the comments of a post that i posted on another users fan or personal page.
I have its long lived access token. I debugged it with the Facebook access token debugger to see if it is valid, and it expires in 2 months.
I have the following permissions: public_profile
, basic_info
, rsvp_event
, email
, read_friendlists
, manage_pages
, publish_actions
, user_birthday
, user_relationships
, user_location
, user_likes
, user_activities
, user_website
, user_friends
& user_about_me
I would like to get the comments of a post the id is 100006454706505_1649297628628711
which is returned to me by a post i previously made.
What is the facebook api call i need to make to read the comments and likes of that post? It looks so simple a question....
$facebook = new Facebook(array(
'appId' => __FB_APP_ID__,
'secret' => __FB_SECRET_APP_ID__
));
$result = $facebook->api('/me/posts', array('access_token' => $access_token, 'limit' => 100));
output:
data: array =
0: array =
id: string = 100006454706505_1613262798898861
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels likes a link.
story_tags: array =
0: array =
0: array =
id: string = 100006454706505
name: string = Kc Hessels
offset: long = 0
length: long = 10
type: string = user
privacy: array =
value: string =
type: string = status
created_time: string = 2014-05-26T23:43:51+0000
updated_time: string = 2014-05-26T23:43:51+0000
1: array =
id: string = 100006454706505_1607721539452987
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels and Elizabeth Garita are now friends.
story_tags: array =
0: array =
0: array =
id: string = 100006454706505
name: string = Kc Hessels
offset: long = 0
length: long = 10
type: string = user
15: array =
0: array =
id: string = 100007895078419
name: string = Elizabeth Garita
offset: long = 15
length: long = 16
type: string = user
actions: array =
0: array =
name: string = Comment
link: string = https://www.facebook.com/100006454706505/posts/1607721539452987
privacy: array =
value: string =
type: string = status
status_type: string = approved_friend
created_time: string = 2014-05-19T19:37:46+0000
updated_time: string = 2014-05-19T19:37:46+0000
2: array =
id: string = 100006454706505_1578102925748182
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels and Nuemy Del Carmen Ramirez Varela are now friends.
story_tags: array =
0: array =
0: array =
id: string = 100006454706505
name: string = Kc Hessels
offset: long = 0
length: long = 10
type: string = user
15: array =
0: array =
id: string = 100006041622188
name: string = Nuemy Del Carmen Ramirez Varela
offset: long = 15
length: long = 31
type: string = user
actions: array =
0: array =
name: string = Comment
link: string = https://www.facebook.com/100006454706505/posts/1578102925748182
privacy: array =
value: string =
type: string = status
status_type: string = approved_friend
created_time: string = 2014-04-11T17:25:51+0000
updated_time: string = 2014-04-11T17:25:51+0000
3: array =
id: string = 100006454706505_1534063350152140
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels is now friends with Jocseline Kassandra Ulate and Monte Campana Carros.
story_tags: array =
0: array =
0: array =
id: string = 100006454706505
name: string = Kc Hessels
offset: long = 0
length: long = 10
type: string = user
31: array =
0: array =
id: string = 100001919869875
name: string = Jocseline Kassandra Ulate
offset: long = 31
length: long = 25
type: string = user
61: array =
0: array =
id: string = 100007783835968
name: string = Monte Campana Carros
offset: long = 61
length: long = 20
type: string = user
privacy: array =
value: string =
type: string = status
status_type: string = approved_friend
created_time: string = 2014-02-20T17:42:25+0000
updated_time: string = 2014-02-20T17:42:25+0000
4: array =
id: string = 100006454706505_1528673807357761
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels and Icam Capacitaciones are now friends.
story_tags: array =
0: array =
0: array =
id: string = 100006454706505
name: string = Kc Hessels
offset: long = 0
length: long = 10
type: string = user
15: array =
0: array =
id: string = 100004980821986
name: string = Icam Capacitaciones
offset: long = 15
length: long = 19
type: string = user
actions: array =
0: array =
name: string = Comment
link: string = https://www.facebook.com/100006454706505/posts/1528673807357761
privacy: array =
value: string =
type: string = status
status_type: string = approved_friend
created_time: string = 2014-02-11T18:29:16+0000
updated_time: string = 2014-02-11T18:29:16+0000
5: array =
id: string = 100006454706505_1525634190995056
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels likes Hotel Club & Resort Monte Campana and Coupon-promotions.
story_tags: array =
0: array =
0: array =
id: string = 100006454706505
name: string = Kc Hessels
offset: long = 0
length: long = 10
type: string = user
17: array =
0: array =
id: string = 168932636493309
name: string = Hotel Club & Resort Monte Campana
offset: long = 17
length: long = 33
type: string = page
55: array =
0: array =
id: string = 1384288225125264
name: string = Coupon-promotions
offset: long = 55
length: long = 17
type: string = page
privacy: array =
value: string =
type: string = status
application: array =
name: string = Pages
id: string = 2530096808
created_time: string = 2014-02-06T20:55:28+0000
updated_time: string = 2014-02-06T20:55:28+0000
6: array =
id: string = 100006454706505_1524425311115944
from: array =
id: string = 100006454706505
name: string = Kc Hessels
story: string = Kc Hessels likes Coupon-promotions and 2 other Pages.
story_tags: array =
( i feel like i miss the bloody obvious)
OK, after fiddling somewhat with it, i found the answer... I get a lot of data, and one piece of data contains the post.
Is there a way to get the post directly, without iterating the whole feed ?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.