Social network data is another great source for the user who is interested in exploring and analyzing social interactions. The main difference between social network data and web data is that social network platforms often provide a semi-structured data format (mostly JSON). Thus, one can easily access the data without the need to inspect how the data is structured. In this recipe, we will illustrate how to use rvest
and rson
to read and parse data from Facebook.
In this recipe, you need to prepare your environment with R installed and a computer that can access the Internet.
Perform the following steps to access data from Facebook:
First, we need to log in to Facebook and access the developer page (https://developers.facebook.com/):
Click on Tools & Support, and select Graph API Explorer:
Next, click on Get Token, and choose Get Access Token: