page = FbGraph::Page.new('FbGraph').fetch( :access_token => USER_ACCESS_TOKEN, :fields => :access_token )
page.insights # gets all of them
How do I just get eg: :name => "page_fan_adds_unique", :period => "day" (or using the insight id if it's known) from the page?
Also, the insight data has paging information on it, but it doesn't seem to have the collection methods on an Insight.
eg:
https://developers.facebook.com/tools/explorer?method=GET&path=FbGraph%2Finsights%2Fpage_fan_adds_unique%2Fday
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/FbGraph/insights/page_fan_adds_unique/day?since=1338938344&until=1339197544",
"next": "https://graph.facebook.com/FbGraph/insights/page_fan_adds_unique/day?since=1339456744&until=1339715944"
}
}
How do I page through the results on a specific Insight once I have it?
(ie: insight = page.insights.first ; insight.next/previous ? )
Though I would prefer to be able to specify the since and until when getting a specific metric from the pages' insights.
I realise I can do:
page.insights :since => 1338938344, :until => 1339197544, :scope => "day"
and then pick out the one metric I care about, but it seems a bit wasteful to be grabbing the data for every insight each time.
Thanks!
page = FbGraph::Page.new('FbGraph').fetch( :access_token => USER_ACCESS_TOKEN, :fields => :access_token )