# NOT RUN {
## See examples for fbOAuth to know how token was created.
load("fb_oauth")
## Getting information about 9th Circle Games' Facebook Page
fb.pages <- FacebookPagesCollection(id = c("9thcirclegames",
"NathanNeverSergioBonelliEditore"),
token = fb_oauth)
## Getting the commenters of the latest 10 posts
fb.comments <- fb.pages %>% FacebookPostsCollection(n = 10) %>%
FacebookCommentsCollection(fields=c("id",
"from.fields(id,name)"),
n = Inf)
## Build a collection of users from who actually commented those posts
fb.commenting.users <- fb.comments %>% FacebookUsersCollection()
## Convert the collection to a data frame
fb.commenting.df <- as.data.frame(fb.commenting.users)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab