Step 1: Registering an Application with Facebook. Install “Rfacebook” package from CRAN : install.packages(“Rfacebook”) Rfacebook package in R provides functions that allow R to access Facebook’s API to get information about posts, comments, likes, group that mention specific keywords & much more. Rfacebook Package: Provides an interface to the Facebook API. Happy Learning! Follow this blog we will learn the basics of extracting Facebook data using R & Facebook API. If you have any feedback, suggestions or questions please comment. Graph API Reference ~ Facebook DeveloperFor more details, please read this Link.įeedback and suggestions are most welcome. In this Word Cloud we are taking only 100 words with minimum frequency of 2. Install.packages(“wordcloud”): For plotting a word cloud Here is the 760 extracted words with frequency. 25 comments only.Ĭreating corpus & removing extra spaces, special characters & other unwanted things. Output: So the first page give me 25 comments only. Url used in above image is copied from cURL code from Graph Explorer. Install.packages(“tm”): A Mining Package for text mining applications within R. It offers a number of transformations that ease the tedium of cleaning data. Install.packages(“rjson”): It allows us to converts JSON object into R objects and vice-versa. Install.packages(“RCurl “): It allows us to compose general HTTP requests and provides convenient functions to fetch data. Copy this URL, we will use this URL in R. If you want more comments click on “next” for next page of comments.Ĭlick on “Get Code” to get the cURL code. Output: Below are post comments in the JSON format. You can also give limit for number of comments to return, like this Type “ Post_id/comments” in below box & click on Submit. Suppose below is the post, we want to analyze. Graph ExplorerĮxtracting Comments from the Public Facebook Post.įirst thing you required is the Post Id of the post. To explore Graph API – Token & Permissions are required, so just click on the “Get Token”.Īs public profiles included by default in permissions, just click on “Get Access Token”.īelow is my access token, which will expire after some time. If you don’t have Facebook developer account, you can upgrade your personal Facebook account to a Facebook Developer account from here this link.Īfter registering as Facebook Developer, go to “Tools & Support”->”Graph API Explorer” In this blog we will learn how to analyze the comments of Public Facebook post using Facebook Graph API Explorer & R!įacebook developer account required to get started with this Facebook Graph API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |