SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Social Media
Analysis using
twitteR
Mohd Shadab Alam
Lead Assistant Manager,
Inductis
What will be covered?
• Introduction to twitter APIs
• How to use twitter APIs in R
• Capturing twitter data
• Google map API
• Tweets Distribution
• Sentiment analysis using twitter data
• Followers accession diagram
Introduction to twitter APIs
• API stands for application interface
“a set of functions and procedures that allow the
creation of applications which access the
features or data of an operating system,
application, or other service”
• Two of the most commonly used
APIs are:
(a) Stream API
(b) REST API
GENERAL INTRODUCTION
Introduction to twitter APIs
TWO APIs: DEFINITION
(a) Stream API
To listen to the live tweets of a user, or
listen to tweets having a particular keyword
we use Stream API
(b) REST API
If we want to retrieve archival data then we
use REST API
Introduction to twitter APIs
API input/output structure
INPUT OUTPUT
User name tweet
Key word Time
Date range Lat long (geo coding)
Lat long range followers
Language retweets
and so on… and so on..
How to use twitter API in R
AUTHENTICATION
We need to log into the twitter
developer account to set up an
authentication channel
dev.twitter.com
Secure authentication key and
password are needed before we
can start using the APIs
How to use twitter API in R
AUTHENTICATION
How to use twitter API in R
AUTHENTICATION
NOTE: Do not forget to register the mobile number
How to use twitter API in R
REGISTERATION PROCESS
Required Libraries
install_github("twitteR",username="geo
ffjentry")
require(twitteR)
setup_twitter_oauth(“f5GhnjWoR17clm
d85PMQfjhHO",
"QUZlAyj9w9O50TbyYdlNBkV7zILLs4
zjhhQFJ2sbBIxhp4Alm2")
Capturing twitter data
API CALL
Sample API calls:
userTimeline('MaxLifeIns', n=3200)
user$getFollowers()
t(sapply(getUser('MaxLifeIns')
$getFollowers(), function(x) c(x$name,
x$location, x$statusesCount)))
Capturing twitter data
HOW DATA LOOKS LIKE
C:Usersshadab
Desktoptwitterfollowers
Google map API
API CALL
Sample API calls:
require(ggmap)
map <- get_map(location = 'India',
zoom = 4)
points <- data.frame(x =
as.numeric(loci$lon), y =
as.numeric(loci$lat))
ggmap(map) + geom_point(data =
points, aes(x = x, y = y), size = 3,
alpha = 1/3, color = "darkblue")
Tweets distribution
MAP
Sentiment analysis
WORD CLOUD
Positive Negative
win poor
appreciable worst
performer decrease
increase loose
nice not
and so on… and so on..
Corpus is created and word is replaced with the stem word like
running is replaced with “run” etc. Frequency of positive and
negative words are counted to mark a sentence as positive or negative.
Followers accession diagram
The DIAGRAM
THOUGHTS!
QUESTIONS?
THANK YOU!!!
THANK YOU SLIDE!!!

Weitere ähnliche Inhalte

Ähnlich wie Social media analysis in R using twitter API

How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)Hani Nurrahmi
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngineikailan
 
Social Developers London update for Twitter Developers
Social Developers London update for Twitter Developers Social Developers London update for Twitter Developers
Social Developers London update for Twitter Developers Angus Fox
 
Howtwitter works
Howtwitter worksHowtwitter works
Howtwitter workszebikhan
 
5 Best Twitter API and Their Features.pdf
5 Best Twitter API and Their Features.pdf5 Best Twitter API and Their Features.pdf
5 Best Twitter API and Their Features.pdfJimmy Finch
 
CSE5656 Complex Networks - Gathering Data from Twitter
CSE5656 Complex Networks - Gathering Data from TwitterCSE5656 Complex Networks - Gathering Data from Twitter
CSE5656 Complex Networks - Gathering Data from TwitterMarcello Tomasini
 
PHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs Twitter
PHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs TwitterPHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs Twitter
PHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs TwitteriMasters
 
Microservices: Utilizando o Twitter como Plataforma
Microservices: Utilizando o Twitter como PlataformaMicroservices: Utilizando o Twitter como Plataforma
Microservices: Utilizando o Twitter como PlataformaJuliana Chahoud
 
Twitter API 2.0
Twitter API 2.0Twitter API 2.0
Twitter API 2.0Alex Payne
 
Development of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and TweetDevelopment of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and TweetMyungjin Lee
 
Building Push Triggers for Logic Apps
Building Push Triggers for Logic AppsBuilding Push Triggers for Logic Apps
Building Push Triggers for Logic AppsBizTalk360
 
TwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキングTwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキングTakashi Nojima
 
Development of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuthDevelopment of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuthMyungjin Lee
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendJoseluis Laso
 

Ähnlich wie Social media analysis in R using twitter API (20)

How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)How to get data from twitter (by hnnrrhm)
How to get data from twitter (by hnnrrhm)
 
Building TweetEngine
Building TweetEngineBuilding TweetEngine
Building TweetEngine
 
Mining Georeferenced Data
Mining Georeferenced DataMining Georeferenced Data
Mining Georeferenced Data
 
Social Developers London update for Twitter Developers
Social Developers London update for Twitter Developers Social Developers London update for Twitter Developers
Social Developers London update for Twitter Developers
 
Howtwitter works
Howtwitter worksHowtwitter works
Howtwitter works
 
Ti.developers.meeting
Ti.developers.meetingTi.developers.meeting
Ti.developers.meeting
 
5 Best Twitter API and Their Features.pdf
5 Best Twitter API and Their Features.pdf5 Best Twitter API and Their Features.pdf
5 Best Twitter API and Their Features.pdf
 
CSE5656 Complex Networks - Gathering Data from Twitter
CSE5656 Complex Networks - Gathering Data from TwitterCSE5656 Complex Networks - Gathering Data from Twitter
CSE5656 Complex Networks - Gathering Data from Twitter
 
AIR & API
AIR & APIAIR & API
AIR & API
 
PHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs Twitter
PHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs TwitterPHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs Twitter
PHP Experience 2016 - [Palestra] Experiências e casos de uso com as APIs Twitter
 
Microservices: Utilizando o Twitter como Plataforma
Microservices: Utilizando o Twitter como PlataformaMicroservices: Utilizando o Twitter como Plataforma
Microservices: Utilizando o Twitter como Plataforma
 
Twitter API 2.0
Twitter API 2.0Twitter API 2.0
Twitter API 2.0
 
Twitter api
Twitter apiTwitter api
Twitter api
 
Development of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and TweetDevelopment of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and Tweet
 
Building Push Triggers for Logic Apps
Building Push Triggers for Logic AppsBuilding Push Triggers for Logic Apps
Building Push Triggers for Logic Apps
 
TwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキングTwitterKitではじめる OAuthスピードクッキング
TwitterKitではじめる OAuthスピードクッキング
 
Twitter sentiment analysis ppt
Twitter sentiment analysis pptTwitter sentiment analysis ppt
Twitter sentiment analysis ppt
 
Development of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuthDevelopment of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuth
 
Twet
TwetTwet
Twet
 
Introduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backendIntroduction to Titanium and how to connect with a PHP backend
Introduction to Titanium and how to connect with a PHP backend
 

Kürzlich hochgeladen

AI Virtual Influencers: The Future of Influencer Marketing
AI Virtual Influencers:  The Future of Influencer MarketingAI Virtual Influencers:  The Future of Influencer Marketing
AI Virtual Influencers: The Future of Influencer MarketingCut-the-SaaS
 
Amplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing ServicesAmplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing ServicesNetqom Solutions
 
The--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media PitchThe--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media Pitch17mos052
 
fraud storyboards powerpoint media project
fraud storyboards powerpoint media projectfraud storyboards powerpoint media project
fraud storyboards powerpoint media project17mos052
 
Music Video Codes and Conventions 2 .pptx
Music Video Codes and Conventions 2 .pptxMusic Video Codes and Conventions 2 .pptx
Music Video Codes and Conventions 2 .pptxjenrobinson12
 
办理伯明翰大学毕业证书文凭学位证书
办理伯明翰大学毕业证书文凭学位证书办理伯明翰大学毕业证书文凭学位证书
办理伯明翰大学毕业证书文凭学位证书saphesg8
 
When-technology-and-Humanity-Cross-1.pptx
When-technology-and-Humanity-Cross-1.pptxWhen-technology-and-Humanity-Cross-1.pptx
When-technology-and-Humanity-Cross-1.pptxReaper61
 
YouScan Company Overview - Social Media Listening with Visual Insights.pdf
YouScan Company Overview - Social Media Listening with Visual Insights.pdfYouScan Company Overview - Social Media Listening with Visual Insights.pdf
YouScan Company Overview - Social Media Listening with Visual Insights.pdfAlexander Sirach
 
Call Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar Delhi
Call Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar DelhiCall Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar Delhi
Call Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar Delhidelhiescort
 
Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...
Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...
Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...jicagig173
 
VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170
VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170
VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170Komal Khan
 
O9654467111 Call Girls In Shahdara Women Seeking Men
O9654467111 Call Girls In Shahdara Women Seeking MenO9654467111 Call Girls In Shahdara Women Seeking Men
O9654467111 Call Girls In Shahdara Women Seeking MenSapana Sha
 
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECTTHE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT17mos052
 
Protecting Your Little Explorer at Home!
Protecting Your Little Explorer at Home!Protecting Your Little Explorer at Home!
Protecting Your Little Explorer at Home!andrekr997
 
Unveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the StarsUnveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the StarsSocioCosmos
 
Upgrade Your Twitter Presence with Socio Cosmos
Upgrade Your Twitter Presence with Socio CosmosUpgrade Your Twitter Presence with Socio Cosmos
Upgrade Your Twitter Presence with Socio CosmosSocioCosmos
 

Kürzlich hochgeladen (19)

AI Virtual Influencers: The Future of Influencer Marketing
AI Virtual Influencers:  The Future of Influencer MarketingAI Virtual Influencers:  The Future of Influencer Marketing
AI Virtual Influencers: The Future of Influencer Marketing
 
Amplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing ServicesAmplify Your Brand with Our Tailored Social Media Marketing Services
Amplify Your Brand with Our Tailored Social Media Marketing Services
 
The--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media PitchThe--Fraud: Netflix Original Media Pitch
The--Fraud: Netflix Original Media Pitch
 
fraud storyboards powerpoint media project
fraud storyboards powerpoint media projectfraud storyboards powerpoint media project
fraud storyboards powerpoint media project
 
Music Video Codes and Conventions 2 .pptx
Music Video Codes and Conventions 2 .pptxMusic Video Codes and Conventions 2 .pptx
Music Video Codes and Conventions 2 .pptx
 
办理伯明翰大学毕业证书文凭学位证书
办理伯明翰大学毕业证书文凭学位证书办理伯明翰大学毕业证书文凭学位证书
办理伯明翰大学毕业证书文凭学位证书
 
looking for escort 9953056974 Low Rate Call Girls In Vinod Nagar
looking for escort 9953056974 Low Rate Call Girls In  Vinod Nagarlooking for escort 9953056974 Low Rate Call Girls In  Vinod Nagar
looking for escort 9953056974 Low Rate Call Girls In Vinod Nagar
 
When-technology-and-Humanity-Cross-1.pptx
When-technology-and-Humanity-Cross-1.pptxWhen-technology-and-Humanity-Cross-1.pptx
When-technology-and-Humanity-Cross-1.pptx
 
young Call girls in Dwarka sector 23🔝 9953056974 🔝 Delhi escort Service
young Call girls in Dwarka sector 23🔝 9953056974 🔝 Delhi escort Serviceyoung Call girls in Dwarka sector 23🔝 9953056974 🔝 Delhi escort Service
young Call girls in Dwarka sector 23🔝 9953056974 🔝 Delhi escort Service
 
YouScan Company Overview - Social Media Listening with Visual Insights.pdf
YouScan Company Overview - Social Media Listening with Visual Insights.pdfYouScan Company Overview - Social Media Listening with Visual Insights.pdf
YouScan Company Overview - Social Media Listening with Visual Insights.pdf
 
Call Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar Delhi
Call Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar DelhiCall Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar Delhi
Call Girls In Dwarka ⏩7838079806 ⏩Escort Service In Patel Nagar Delhi
 
Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...
Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...
Models Call Girls Shettihalli - 7001305949 Escorts Service 50% Off with Cash ...
 
VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170
VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170
VIP Moti Bagh Call Girls Free Doorstep Delivery 9873777170
 
O9654467111 Call Girls In Shahdara Women Seeking Men
O9654467111 Call Girls In Shahdara Women Seeking MenO9654467111 Call Girls In Shahdara Women Seeking Men
O9654467111 Call Girls In Shahdara Women Seeking Men
 
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECTTHE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
THE FRAUD NETFLIX ORIGINAL MEDIA PITCH PROJECT
 
Protecting Your Little Explorer at Home!
Protecting Your Little Explorer at Home!Protecting Your Little Explorer at Home!
Protecting Your Little Explorer at Home!
 
Unveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the StarsUnveiling SOCIO COSMOS: Where Socializing Meets the Stars
Unveiling SOCIO COSMOS: Where Socializing Meets the Stars
 
Hot Sexy call girls in Ramesh Nagar🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Ramesh Nagar🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Ramesh Nagar🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Ramesh Nagar🔝 9953056974 🔝 Delhi escort Service
 
Upgrade Your Twitter Presence with Socio Cosmos
Upgrade Your Twitter Presence with Socio CosmosUpgrade Your Twitter Presence with Socio Cosmos
Upgrade Your Twitter Presence with Socio Cosmos
 

Social media analysis in R using twitter API

  • 1. Social Media Analysis using twitteR Mohd Shadab Alam Lead Assistant Manager, Inductis
  • 2. What will be covered? • Introduction to twitter APIs • How to use twitter APIs in R • Capturing twitter data • Google map API • Tweets Distribution • Sentiment analysis using twitter data • Followers accession diagram
  • 3. Introduction to twitter APIs • API stands for application interface “a set of functions and procedures that allow the creation of applications which access the features or data of an operating system, application, or other service” • Two of the most commonly used APIs are: (a) Stream API (b) REST API GENERAL INTRODUCTION
  • 4. Introduction to twitter APIs TWO APIs: DEFINITION (a) Stream API To listen to the live tweets of a user, or listen to tweets having a particular keyword we use Stream API (b) REST API If we want to retrieve archival data then we use REST API
  • 5. Introduction to twitter APIs API input/output structure INPUT OUTPUT User name tweet Key word Time Date range Lat long (geo coding) Lat long range followers Language retweets and so on… and so on..
  • 6. How to use twitter API in R AUTHENTICATION We need to log into the twitter developer account to set up an authentication channel dev.twitter.com Secure authentication key and password are needed before we can start using the APIs
  • 7. How to use twitter API in R AUTHENTICATION
  • 8. How to use twitter API in R AUTHENTICATION NOTE: Do not forget to register the mobile number
  • 9. How to use twitter API in R REGISTERATION PROCESS Required Libraries install_github("twitteR",username="geo ffjentry") require(twitteR) setup_twitter_oauth(“f5GhnjWoR17clm d85PMQfjhHO", "QUZlAyj9w9O50TbyYdlNBkV7zILLs4 zjhhQFJ2sbBIxhp4Alm2")
  • 10. Capturing twitter data API CALL Sample API calls: userTimeline('MaxLifeIns', n=3200) user$getFollowers() t(sapply(getUser('MaxLifeIns') $getFollowers(), function(x) c(x$name, x$location, x$statusesCount)))
  • 11. Capturing twitter data HOW DATA LOOKS LIKE C:Usersshadab Desktoptwitterfollowers
  • 12. Google map API API CALL Sample API calls: require(ggmap) map <- get_map(location = 'India', zoom = 4) points <- data.frame(x = as.numeric(loci$lon), y = as.numeric(loci$lat)) ggmap(map) + geom_point(data = points, aes(x = x, y = y), size = 3, alpha = 1/3, color = "darkblue")
  • 14. Sentiment analysis WORD CLOUD Positive Negative win poor appreciable worst performer decrease increase loose nice not and so on… and so on.. Corpus is created and word is replaced with the stem word like running is replaced with “run” etc. Frequency of positive and negative words are counted to mark a sentence as positive or negative.