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

getPost() no likes dataframe and NA columns for `comments$from_id` and `comments$from_name` #161

Closed jihjihk closed 6 years ago

jihjihk commented 6 years ago

Hello!

I am running 0.6.15 version of Rfacebook. The post dataframe from post = getPost(post_id, token=my_oauth) doesn't include the likes sub-dataframe and also returns all NA values for comments$from_id and comments$from_name.

Thank you!

luanamarinho commented 6 years ago

Hello! I was having the same problem, but I finally managed to get a list of (only) 3 components (post, comments and likes) using getPost through the command lines below.

As you can see, the arguments "comments", "likes", and "reactions" are set to their default values. I didn't specify the api version and the access token was the temporary "user access token" obtained via the Graph API Explorer (not the app you might have created). At least this is how it worked for me! I hope it helps.

## temporary access token
    fb_oauth <- "user access token"

    qtd <- 5000

    #pag_loop$id[1]
    #[1] "242862559586_10156144461009587"

    # arguments with default value (reactions = F, likes = T, comments = T)
    x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd)

    str(x)
    # retrieves a list of 3: posts, likes, comments

Best!

jihjihk commented 6 years ago

@luanamarinho amazing, it worked. Thank you!