# NOT RUN {
## See examples for fbOAuth to know how token was created.
load("fb_oauth")
## Getting information about two example Facebook Pages
fb.pages <- FacebookPagesCollection(id = c("9thcirclegames",
"NathanNeverSergioBonelliEditore"),
token = fb_oauth)
## Pull the latest 10 posts from each page
fb.posts <- FacebookPostscollection(id = fb.pages, token = fb_oauth, n = 10)
## Pull all the available posts from each page
fb.posts.inf <- FacebookPostscollection(id = fb.pages, token = fb_oauth, n = Inf)
## Convert the collection to a data frame
fb.posts.df <- as.data.frame(fb.posts)
# The same as before in a more compact fashion using the pipe operator
# chaining from a Pages Collection
fb.posts.pipe <- FacebookPagesCollection(id = c("9thcirclegames",
"NathanNeverSergioBonelliEditore"),
token = fb_oauth) %>% FacebookPostsCollection(n = 10)
## Build a collection of sharedposts from a posts collection
fb.sharedposts <- FacebookPostsCollection(id = fb.posts, token = fb_oauth, n = Inf)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab