jan5
jan5

Reputation: 1179

How to extract the number of "likes" from a Facebook page using R

I want to extract the number of users who have "liked " a page, using the R language with the Facebook Graph API. I am new to Facebook Graph API.

I dont think there is a package in R related to this API.

Is there any tutorial on how to access the Facebook API graph objects using R?

Upvotes: 4

Views: 1923

Answers (1)

Wasim
Wasim

Reputation: 896

jan: I am not at all aware of R language. But actually you can easily fetch number of likes of your page using graph api with the following url:

https://graph.facebook.com/${page_id} - (Can see the response by hitting this url on a browser)

Just place this code in the javascript section of your page

FB.api( '/${page_id}', function (response) { alert(response.likes) } );

Upvotes: 2

Related Questions