pablobarbera / Rfacebook

Dev version of Rfacebook package: Access to Facebook API via R
http://cran.r-project.org/web/packages/Rfacebook
350 stars 250 forks source link

Error in getUsers when user is public Facebook page #93

Closed ashgreat closed 7 years ago

ashgreat commented 7 years ago

I am getting this error for several pages I tried (including Trump and Clinton pages). I can get the posts and comments fine.

getUsers(users = "starbucks", token = fb_oauth)

Error in callAPI(query, token) : (#100) Tried accessing nonexisting field (first_name) on node type (Page)

pablobarbera commented 7 years ago

Weird. That works for me. Are you using a temporary token or one created with a new app? Perhaps the issue could be that you cannot query users outside of your app? It worked for me with a temporary token:

> getUsers(users = "starbucks", token = fb_oauth)
           id      name username first_name middle_name last_name gender
1 22092443056 Starbucks       NA         NA          NA        NA     NA
  locale                category    likes
1     NA Food & Beverage Company 36543737
                                                                                                                                               picture
1 https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/12938224_10154045006558057_3818607553691242482_n.png?oh=2db8cac33caa01ac1ff68610ddc7f737&oe=58DE10BD
> getUsers(users = "hillaryclinton", token = fb_oauth)
               id            name username first_name middle_name
1 889307941125736 Hillary Clinton       NA         NA          NA
  last_name gender locale   category    likes
1        NA     NA     NA Politician 10030700
                                                                                                                                              picture
1 https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/13619932_1181179818605212_8343925786278448182_n.jpg?oh=8553e70df5be4059f2e1ff31a592bf94&oe=58EFB496
> getUsers(users = "donaldtrump", token = fb_oauth)
            id            name username first_name middle_name last_name
1 153080620724 Donald J. Trump       NA         NA          NA        NA
  gender locale      category    likes
1     NA     NA Public Figure 16669020
                                                                                                                                   picture
1 https://scontent.xx.fbcdn.net/v/t1.0-1/p200x200/557493_10151443611110725_645976657_n.jpg?oh=7777c1a8bf56763d69456c27ea7dc976&oe=58DCEB97