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 getPost - Posts with lots of comments #159

Open ricardostary opened 6 years ago

ricardostary commented 6 years ago

Hello Pablo!

First of all, excellent package!

I am having an issue while trying to retrieve comments from posts using the getPost function. I get the following error when the post has lots of comments:

Error in while (n.l < n.likes & length(content$data) > 0 & !is.null(url <- content$paging$next)) { : argument is of length zero

Any suggestion?

Thanks in advance!

BroVic commented 6 years ago

Check the n argument - the maximum number of comments and likes to return. The default is 500 and you should try extending it. Use getPage to get details like likes_count or comments_count to see if this is the problem.

prokulski commented 6 years ago

I've got the same problem:

post id = 50063176484_10155331784471485 likes_count = 1453 comments_count = 478

getPost(post_id, token = fb_oauth)

gives:

Error in while (n.l < n.likes & length(content$data) > 0 & !is.null(url <- content$paging$`next`)) { : 
  argument is of length zero

Adding n parameter with 10, 100, 1000 or anything else causes the same error.

agilebean commented 6 years ago

I can confirm what @ricardostary and @prokulski said: getPost() returns this error no matter which arguments are given.

Would be wonderful if someone could have a look!

prokulski commented 6 years ago

I've installed dev version from git and now it works great.

agilebean commented 6 years ago

@prokulski thanks, just did it and it works.

rayms commented 6 years ago

This also works, but does anyone encounter the problem with getPost that the argument, likes = TRUE does not return a dataframe that contains the Facebook IDs of all users that liked the post?

CZARKING commented 6 years ago

I am experiencing the same problem as rayms.

OMAR10106 commented 6 years ago

prokulski

How did you solve it? please

rayms commented 6 years ago

Changes to the Facebook API made this data unavailable, I believe since v2.11.

OMAR10106 commented 6 years ago

I've installed dev version from git and now it works great.???

OMAR10106 commented 6 years ago

I installed the development version now works very well. as well?