I'm trying to retrieve the number of likes on a page. The request shows up like this:
{
"id": "1453470311647266",
"about": "EMBRACE YOUR WEIRDNESS! I am unprofessionally professional human being. Eyebrow and life enthusist. Instagram \u0040caradelevingne STOP LABELING! START LIVING",
"can_post": true,
"category": "Public Figure",
"checkins": 0,
"cover": {
"cover_id": "1453470654980565",
"offset_x": 0,
"offset_y": 31,
"source": "https://scontent.xx.fbcdn.net/hphotos-xap1/t31.0-0/p480x480/11872112_1453470654980565_1341024201989338022_o.jpg",
"id": "1453470654980565"
},
"has_added_app": false,
"is_community_page": false,
"is_published": true,
"likes": 3249743,
"link": "https://www.facebook.com/CaraDelevingneOfficialPage/",
"name": "Cara Delevingne",
"talking_about_count": 23035,
"username": "CaraDelevingneOfficialPage",
"website": "http://www.instagram.com/caradelevingne",
"were_here_count": 0
}
res, err := fb.Get("/1453470311647266", fb.Params{
"access_token": token,
})
if err != nil {
e, ok := err.(*fb.Error)
if ok == true {
Logger.Errorf("Facebook error: [message:%v] [type:%v] [code:%v] [subcode:%v]", e.Message, e.Type, e.Code, e.ErrorSubcode)
}
return err
} else {
likes, ok := res.Get("likes").(string) // reflect.Kind told me it was a string
if ok == false {
// THIS IS ALWAYS GOING THERE
Logger.Errorf("Error while parsing facebook result (likes): %s", "not a string")
return false
}
}
}