## Not run: ------------------------------------
# ## See examples for fbOAuth to know how token was created.
# ## Getting page impressions for Facebook's Facebook Page
# ## (only owner or admin of page)
# load("fb_oauth")
# insights <- getInsights(object_id="20531316728", token=fb_oauth, metric='page_impressions')
# ## Getting post impressions for a random Facebook's page post
# ## (only owner or admin of page)
# insights <- getInsights(object_id='221568044327801_754789777921289',
# token=fb_oauth, metric='post_impressions', period='days_28')
# ## Getting page fans for date range
# ## (only owner or admin of page)
# insights <- getInsights(object_id='221568044327801',
# token=fb_oauth, metric=c'page_fans', period='lifetime',
# parms='&since=2015-01-01&until=2015-01-31', version=2.5)
# #' ## Getting page fans AND page impressions for date range
# ## (only owner or admin of page)
# insights <- getInsights(object_id='221568044327801',
# token=fb_oauth, metric=c('page_fans','page_impressions'), period=c('lifetime','day'),
# parms='&since=2015-01-01&until=2015-01-31')
# ## Count of fans by country
# insights <- getInsights(object_id='221568044327801_754789777921289',
# token=fb_oauth, metric='page_fans_country', period='lifetime')
## ---------------------------------------------
Run the code above in your browser using DataLab