if anyone can help me I would be grateful, I am trying to solve but without success!
I have a dataframe with a list of IDs. With "Rfacebook's" package, I apply the "getPost's" function to receive all the data that I need. However, when I do the loop, only returns me a single result and repeats it dozens of times.
My code (edit with after contributions)
#final is a value in environment with all IDs that I need to do the getPost
verificador <- 1
listap <- c()
listap2 <- c()
p <- list()
while (verificador <= length(final)) {
p[[verificador]] <- getPost(final[[verificador]], token, comments = F, reactions = T, n.reactions = 50000, api = NULL)
verificador = verificador + 1
}
final(List of IDS):
[1] "193944443965876_1884261211600849"
[2] "193944443965876_1884261211600849"
[3] "193944443965876_1884261211600849"
[4] "193944443965876_1884261211600849"
[5] "193944443965876_1884261211600849"
[6] "193944443965876_1884261211600849"
[7] "193944443965876_1884261211600849"
[8] "193944443965876_1884261211600849"
... continue
Results of loop:
[[1]]
from_id from_name
1 193944443965876 XYZ
message
1 O lugar de uma t-shirt linda nunca será no fundo do armário!
created_time type
1 2017-07-09T18:52:47+0000 video
link
1 https://www.facebook.com/XYZ/videos/1884261211600849/
id likes_count
1 193944443965876_1884261211600849 2729
comments_count shares_count
1 69 44
[[2]]
from_id from_name
1 193944443965876 XYZ
message
1 O lugar de uma t-shirt linda nunca será no fundo do armário!
created_time type
1 2017-07-09T18:52:47+0000 video
link
1 https://www.facebook.com/XYZ/videos/1884261211600849/
id likes_count
1 193944443965876_1884261211600849 2729
comments_count shares_count
1 69 44
continue...