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

Unable to retrieve likes and commenter names/ids using getPost() #176

Open kumarhk opened 6 years ago

kumarhk commented 6 years ago

Hi all,

Thank you to @pablobarbera for a great package! I'm hoping someone can help me with two issues I'm having with the getPost() function.

  1. No matter how I specify the function, I can't get it to output the three dataframes (post, likes, and comments) as desired. The "likes" dataframe is never generated.
  2. In the comments dataframe that is successfully generated, the values for the variables from_id and from_name are always NA.

Here is some example code:

> id <- as.character(posts[589,"id"])
> id 
[1] "458400667664362_714715445366215"
> 
> qtd <- 100
> qtd
[1] 100
> 
> # Attempt with default values
> temp <- getPost(id, token=fb_token, n=qtd)
> length(temp)
[1] 2
> # list contains only two items: post df and comments df
> 
> # Attempt with comments=T, likes=T, reactions=F specified
> temp2 <- getPost(id, token=fb_token, n=qtd, comments=T, likes=T, reactions=F)
> length(temp2)
[1] 2
> # list contains only two items: gives only post df and comments df
> 
> # Look inside the comments df
> temp$comments[1,1:3]
  from_id from_name                                             message
1      NA        NA I missed  it,any other workshop? In the near future
> # from_id and from_name are missing
floresfdev commented 6 years ago

Hi @kumarhk,

The same problem just happened to me. It's because of a Facebook constraint for tokens not linked to the page admin. For more info see this comment on another issue: https://github.com/pablobarbera/Rfacebook/issues/172#issuecomment-366279411