Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{getPost() does not retrieve reactions' component} & {"reactions" and "likes" with the same logical value return neither error nor warning msg} #160

Open
luanamarinho opened this issue Jan 10, 2018 · 1 comment

Comments

@luanamarinho
Copy link

luanamarinho commented Jan 10, 2018

[Win 10; R 3.4.3; RStudio 1.1.383; Rfacebook 0.6.15]

Hi @pablobarbera !

I would like to point out two things, if I may:

  1. Even though I have tried all possible combinations of the logical values for the arguments "comments", "reactions" and "likes", the best result I could get so far was a list of 3 components for each post ("post", "comments", and "likes") - that is, without the "reactions" component. Nevertheless, according to the package's documentation, "getPost returns a list with up to four components: post, likes, comments, and reactions." getPost

  2. Besides the (somehow strange) fact that "reactions" should be FALSE (default) in order to retrieve info on the reactions to the post(s), I noticed a seemingly odd result: if I simultaneously set "reactions" and "likes" to be either TRUE or FALSE, R returns neither an error nor a warning message. The reason I find it a bit odd is because likes = !reactions in its own definition.

#packageVersion("Rfacebook")
#[1] ‘0.6.15'

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

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

# Comments = T, likes = F, reactions = F, without api (default NULL)
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, comments = TRUE,
                           likes = FALSE, reactions = FALSE)
str(x)
# retrieves a list of 2 (comments and post)

#comments = T, likes = F, reactions = F, without api (default NULL)
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, comments = TRUE,
            likes = TRUE, reactions = TRUE)
str(x)
# retrieves a list of 2 (comments and post)

x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, comments = TRUE,
            likes = FALSE, reactions = TRUE, api = "v2.11") #did not run without api
str(x)
# retrieves a list of 2 (comments and post)

# arguments with default value (reactions =F, likes = T, comments = T, api = NULL)
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd)
str(x)
# retrieves a list of 3: posts, likes, comments

# default values for arguments comments, likes (except reactions)
# did not run without api
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, reactions = TRUE, api = "v2.11")
str(x)
# retrieves a list of 2: posts, comments

# default values for arguments comments, likes, and api (except reactions)
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, reactions = FALSE)
str(x)
# retrieves a list of 3: posts, likes, comments

# did not run without api
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, reactions = TRUE, api = "v2.11")
str(x)
# retrieves a list of 2: posts, comments

# api default
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, likes  = FALSE)
str(x)
# retrieves a list of 2: posts, comments

# api default
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, likes  = TRUE)
str(x)
# retrieves a list of 3: posts, likes, comments` 

# api default
x <- getPost(pag_loop$id[1], token = fb_oauth, n = qtd, likes  = TRUE)
str(x)
# retrieves a list of 3: posts, likes, comments

Therefore, could anyone please help me understand why the getPost function is behaving like that? Is there a problem in my code and/or in the function itself?

Best,

Luana

@luanamarinho luanamarinho changed the title {getPost() does not retrieve reactions' component} & {"reactions" and "likes" with the same logical value returns neither error nor warning msg} {getPost() does not retrieve reactions' component} & {"reactions" and "likes" with the same logical value return neither error nor warning msg} Jan 10, 2018
@luanamarinho
Copy link
Author

Up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant