SlideShare a Scribd company logo
Mining Social Media data in R
Set up Facebook API and download data
November 21, 2017
Seongho An, MSW | School of Social Policy and Practice , University of Pennsylvania
Workshop for MSSP630
Potential of Social media
Set up Facebook API
Go to Facebook API page (https://developers.facebook.com/docs/graph-api) and log in
with your Facebook id and password
Click “Add a
New App”
Set up Facebook API
Create a name you like
Put your current email
Click “Create App ID”
Set up Facebook API
Click Settings
Set up Facebook API
App ID and App Secret are automatically created. You will need them in authentication
Click “Add Platform”
Set up Facebook API
Put your own website URL. If you don’t have any,
use my website for this workshop.
*This has nothing to do with your data work in R
Set up Facebook Api in R
Install necessary packages
App ID App Secret
Copy this URL
Set up Facebook Api in R
Paste the URL in the "Valid OAuth redirect URIs"
Paste the URL in the ”Website"
Download Facebook data
Download 50,000 posts sent between 11/01/2016 and 10/31/2017 by the
Facebook page PennSP2
Reactions: R will get the
total count of Facebook
reactions: love, haha, wow,
sad, angry.
Feed: If TRUE, the function
will also return posts on
the page that were made
by others
Download Facebook data
View your created data frame named sp2_post
Download Facebook data
View your created data frame named sp2_post
Download Facebook data
Save the data as a CSV file
Sentiment analysis
Install and library necessary packages
To install rCharts, you
need these three lines of
code
Sentiment analysis
Import the data file. Make sure the data file is in your working directory (getwd())
Sentiment analysis
Clean and Standardize timestamps
Sentiment analysis
Calculating statistics of engagement
Sentiment analysis
Calculating statistics of engagement
Sentiment analysis
Average number of posts per day
Sentiment analysis
Average number of likes per day
Sentiment analysis
Generate a cumulative count plot
Sentiment analysis
Generate a plot for Facebook reactions
Sentiment analysis
Generate a cumulative count plot
Sentiment analysis
Generate an interactive chart
Word cloud
26
Import the data file. Make sure the data file is in your working directory
Word cloud
27
Clean up the messages by removing special characters, symbols, and
punctuations
Word cloud
28
Import the data file. Make sure the data file is in your working directory
Word cloud
29

More Related Content

What's hot

How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...
How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...
How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...
Zeo
 
Reshaping the Landscape of Search: Tracking Google’s Algorithm changes
Reshaping the Landscape of Search: Tracking Google’s Algorithm changesReshaping the Landscape of Search: Tracking Google’s Algorithm changes
Reshaping the Landscape of Search: Tracking Google’s Algorithm changes
Fernando Angulo
 
Basic SEO for Realtors
Basic SEO for RealtorsBasic SEO for Realtors
Basic SEO for Realtors
Matthew Rathbun
 
Presentation Week10
Presentation Week10Presentation Week10
Presentation Week10
guest052692
 
Learn How Google Algorithm Works in 2017 - Albert James Burleson
Learn How Google Algorithm Works in 2017 - Albert James Burleson Learn How Google Algorithm Works in 2017 - Albert James Burleson
Learn How Google Algorithm Works in 2017 - Albert James Burleson
Albert James Burleson
 
Google search architecture services in Hyderabad
Google search architecture services in HyderabadGoogle search architecture services in Hyderabad
Google search architecture services in Hyderabad
Martin James
 

What's hot (6)

How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...
How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...
How to Use Data Studio’s External Connectors for Measuring SEO KPI’s - Ezgi G...
 
Reshaping the Landscape of Search: Tracking Google’s Algorithm changes
Reshaping the Landscape of Search: Tracking Google’s Algorithm changesReshaping the Landscape of Search: Tracking Google’s Algorithm changes
Reshaping the Landscape of Search: Tracking Google’s Algorithm changes
 
Basic SEO for Realtors
Basic SEO for RealtorsBasic SEO for Realtors
Basic SEO for Realtors
 
Presentation Week10
Presentation Week10Presentation Week10
Presentation Week10
 
Learn How Google Algorithm Works in 2017 - Albert James Burleson
Learn How Google Algorithm Works in 2017 - Albert James Burleson Learn How Google Algorithm Works in 2017 - Albert James Burleson
Learn How Google Algorithm Works in 2017 - Albert James Burleson
 
Google search architecture services in Hyderabad
Google search architecture services in HyderabadGoogle search architecture services in Hyderabad
Google search architecture services in Hyderabad
 

Similar to Facebook api setting and mining data

Facebook 3rd Party Api
Facebook 3rd Party ApiFacebook 3rd Party Api
Facebook 3rd Party Api
Yoss Cohen
 
Social Media Mining using R
Social Media Mining using RSocial Media Mining using R
Social Media Mining using R
Subhankar Mishra
 
Shiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development GuidelinesShiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development Guidelines
Roy Pereira
 
Creating a content managed facebook app
Creating a content managed facebook appCreating a content managed facebook app
Creating a content managed facebook app
OS-Cubed, Inc.
 
How to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowHow to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft Flow
Dragan Panjkov
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
Sathiyamoorthi
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
Sathiyamoorthi
 
Facebook_Coin
Facebook_CoinFacebook_Coin
Facebook_Coin
Sathiyamoorthi
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
Sathiyamoorthi
 
The All About Facebook Workshop - 2016 Presented by Leigh Jewiss (RDA Illawa...
The All About Facebook Workshop -  2016 Presented by Leigh Jewiss (RDA Illawa...The All About Facebook Workshop -  2016 Presented by Leigh Jewiss (RDA Illawa...
The All About Facebook Workshop - 2016 Presented by Leigh Jewiss (RDA Illawa...
Regional Development Australia (RDA) Illawarra
 
How to create custom connector for Microsoft Flow
How to create custom connector for Microsoft FlowHow to create custom connector for Microsoft Flow
How to create custom connector for Microsoft Flow
Dragan Panjkov
 
How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18
Dragan Panjkov
 
Facebook app
Facebook appFacebook app
Facebook app
Business Blogging
 
Developing Facebook Application
Developing Facebook ApplicationDeveloping Facebook Application
Developing Facebook Application
Sandeep Varma
 
How to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowHow to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft Flow
Dragan Panjkov
 
Project Deliverable 3 Database and Data Warehousing DesignDue.docx
Project Deliverable 3 Database and Data Warehousing DesignDue.docxProject Deliverable 3 Database and Data Warehousing DesignDue.docx
Project Deliverable 3 Database and Data Warehousing DesignDue.docx
anitramcroberts
 
Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...
Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...
Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...
Bill Graham
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
kevinreiss
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
guest3c5c731bc
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
nithiya
 

Similar to Facebook api setting and mining data (20)

Facebook 3rd Party Api
Facebook 3rd Party ApiFacebook 3rd Party Api
Facebook 3rd Party Api
 
Social Media Mining using R
Social Media Mining using RSocial Media Mining using R
Social Media Mining using R
 
Shiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development GuidelinesShiny Agency's Facebook Development Guidelines
Shiny Agency's Facebook Development Guidelines
 
Creating a content managed facebook app
Creating a content managed facebook appCreating a content managed facebook app
Creating a content managed facebook app
 
How to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft FlowHow to create custom Connector for Microsoft Flow
How to create custom Connector for Microsoft Flow
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 
Facebook_Coin
Facebook_CoinFacebook_Coin
Facebook_Coin
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 
The All About Facebook Workshop - 2016 Presented by Leigh Jewiss (RDA Illawa...
The All About Facebook Workshop -  2016 Presented by Leigh Jewiss (RDA Illawa...The All About Facebook Workshop -  2016 Presented by Leigh Jewiss (RDA Illawa...
The All About Facebook Workshop - 2016 Presented by Leigh Jewiss (RDA Illawa...
 
How to create custom connector for Microsoft Flow
How to create custom connector for Microsoft FlowHow to create custom connector for Microsoft Flow
How to create custom connector for Microsoft Flow
 
How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18How to create custom connector for Microsoft Flow - SPSNL18
How to create custom connector for Microsoft Flow - SPSNL18
 
Facebook app
Facebook appFacebook app
Facebook app
 
Developing Facebook Application
Developing Facebook ApplicationDeveloping Facebook Application
Developing Facebook Application
 
How to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft FlowHow to: Create a custom connector for Microsoft Flow
How to: Create a custom connector for Microsoft Flow
 
Project Deliverable 3 Database and Data Warehousing DesignDue.docx
Project Deliverable 3 Database and Data Warehousing DesignDue.docxProject Deliverable 3 Database and Data Warehousing DesignDue.docx
Project Deliverable 3 Database and Data Warehousing DesignDue.docx
 
Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...
Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...
Hadoop Summit 2011 - Using a Hadoop Data Pipeline to Build a Graph of Users a...
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
 
Doing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to ProductivityDoing More with Less: Mash Your Way to Productivity
Doing More with Less: Mash Your Way to Productivity
 
Facebook Coin
Facebook CoinFacebook Coin
Facebook Coin
 

Recently uploaded

Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
hyfjgavov
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
VyNguyen709676
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Kaxil Naik
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
ihavuls
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
SaffaIbrahim1
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
ElizabethGarrettChri
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
AndrzejJarynowski
 
Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024
facilitymanager11
 
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
yuvarajkumar334
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
a9qfiubqu
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
xclpvhuk
 

Recently uploaded (20)

Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
一比一原版兰加拉学院毕业证(Langara毕业证书)学历如何办理
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
 
Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024
 
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS_NOTES FOR MCA
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
原版一比一弗林德斯大学毕业证(Flinders毕业证书)如何办理
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
一比一原版(Unimelb毕业证书)墨尔本大学毕业证如何办理
 

Facebook api setting and mining data

Editor's Notes

  1. LiveSlide Site https://youtu.be/JMUw4Ndpbdw