SlideShare una empresa de Scribd logo
1 de 66
Descargar para leer sin conexión
KIT – University of the State of Baden-Württemberg and
National Research Center of the Helmholtz Association
KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI)
www.kit.edu
Social Computing
Analysing Social Media: Theory and Hackathon
Dr. Simon Caton and Dr. Martin Chorley
Karlsruhe Service Research Institute
www.ksri.kit.edu
About us
Simon
§  PostDoc @KIT
§  CS PhD @Cardiff University
§  Working on / with:
Martin
§  PostDoc @Cardiff University
§  CS PhD @Cardiff University
§  Working on / with:
Karlsruhe Service Research Institute
www.ksri.kit.edu
Agenda
1330 – 1500 Intro, Social Media Analysis, Team Formation
1530 – 1615: Project Brainstorming + Machine Setup
1615 – 1900: Implementation Session I
1900 – 2000: Dinner on the go
2000 – 2200: Implementation Session II
2200+: Debrief + Informal Get Together
1700 – 1730 (Tomorrow) Demos and Winner Selection
3
KIT – University of the State of Baden-Württemberg and
National Research Center of the Helmholtz Association
KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI)
www.kit.edu
Social Computing: Brief Overview
Karlsruhe Service Research Institute
www.ksri.kit.edu
Social Computing?
§  “…any type of computing application in which software
serves as an intermediary or a focus for a social relation”
D. Schuler, Social Computing, CACM, 37(1) 1994.
§  “A social structure in which technology puts power in
individuals and communities, not institutions”
C. Charron, J. Favier, and C. Li, Social Computing: How Networks Erode
Institutional Power, and What to Do about It, Forrester Customer Report, 2006.
§  “Computational facilitation of social studies and human
social dynamics as well as the design and use of ICT that
consider social context”
F.-Y. Wang, D. Zeng, K. Carley, W. Mao, “Social Computing: From Social
Informatics to Social Intelligence”, IEEE Intelligent Systems, 2, 2007.
5
Karlsruhe Service Research Institute
www.ksri.kit.edu
Main Social Computing Domains
6
Giuseppe Lugano. Social Computing: A Classification of Existing Paradigms. IEEE Social
Computing 2012
Karlsruhe Service Research Institute
www.ksri.kit.edu
7
Karlsruhe Service Research Institute
www.ksri.kit.edu
8
Karlsruhe Service Research Institute
www.ksri.kit.edu
9
Karlsruhe Service Research Institute
www.ksri.kit.edu
What we are going to look at
10
Foundations
Social Media
Platforms
Karlsruhe Service Research Institute
www.ksri.kit.edu
Learning Outcomes of the Session
§  to learn the basics of analysing social media via a hands
on session with Facebook, Twitter or Foursquare
§  to gain hands on experience of accessing data, creating
apps and running analysis methods
§  to gain experience in team-based rapid prototyping
11
Karlsruhe Service Research Institute
www.ksri.kit.edu
How this will work
Choose
Create teams: .
12
KIT – University of the State of Baden-Württemberg and
National Research Center of the Helmholtz Association
KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI)
www.kit.edu
Social Media Analysis
Crash Course: JSON, Twitter, Foursquare, and Facebook
13
Karlsruhe Service Research Institute
www.ksri.kit.edu
A
P
I
pplication
rogramming
nterface
Karlsruhe Service Research Institute
www.ksri.kit.edu
15
Server
Server
Server
Server
http request
json response
REST API
Karlsruhe Service Research Institute
www.ksri.kit.edu
16
client-server
stateless
cacheable
layered
uniform interface
Karlsruhe Service Research Institute
www.ksri.kit.edu
17
GET
PUT
POST
DELETE
Karlsruhe Service Research Institute
www.ksri.kit.edu
18
J
S
O
N
ava
cript
bject
otation
Karlsruhe Service Research Institute
www.ksri.kit.edu
19
Karlsruhe Service Research Institute
www.ksri.kit.edu
20
}string{ value:
,
][ value
,
objects:
arrays:
Karlsruhe Service Research Institute
www.ksri.kit.edu
21
values:string
number
object
array
true
false
null
Karlsruhe Service Research Institute
www.ksri.kit.edu
22
Karlsruhe Service Research Institute
www.ksri.kit.edu
23
Karlsruhe Service Research Institute
www.ksri.kit.edu
24
How does the API
know who we are?
Karlsruhe Service Research Institute
www.ksri.kit.edu
25
How do we know
who the user is?
Karlsruhe Service Research Institute
www.ksri.kit.edu
26
How does the
service know we
can access data?
Karlsruhe Service Research Institute
www.ksri.kit.edu
27
OAuth
1. identification
2. authentication
3. access to data
Karlsruhe Service Research Institute
www.ksri.kit.edu
28
user
app
api
provider
user requests login
redirectuser
api provider confirms identity
user grants permission
accesskey
Karlsruhe Service Research Institute
www.ksri.kit.edu
29
Twitter
Karlsruhe Service Research Institute
www.ksri.kit.edu
30
Karlsruhe Service Research Institute
www.ksri.kit.edu
31
Karlsruhe Service Research Institute
www.ksri.kit.edu
32
Documentation
dev.twitter.com
Karlsruhe Service Research Institute
www.ksri.kit.edu
33
Karlsruhe Service Research Institute
www.ksri.kit.edu
34
REST API
Streaming API
vs.
Karlsruhe Service Research Institute
www.ksri.kit.edu
35
Server
http request
json response
REST API
Karlsruhe Service Research Institute
www.ksri.kit.edu
36
API Endpoints
https://api.twitter.com/1.1
statuses/...
users/...
search/...
lists/...
Karlsruhe Service Research Institute
www.ksri.kit.edu
37
Server
http request
tweet
Streaming API
tweet
tweet
...
connection closes
Karlsruhe Service Research Institute
www.ksri.kit.edu
38
Streaming API
https://stream.twitter.com/1.1/
statuses/filter.json
Karlsruhe Service Research Institute
www.ksri.kit.edu
39
Demo!
Karlsruhe Service Research Institute
www.ksri.kit.edu
40
Karlsruhe Service Research Institute
www.ksri.kit.edu
41
Karlsruhe Service Research Institute
www.ksri.kit.edu
42
Karlsruhe Service Research Institute
www.ksri.kit.edu
43
Karlsruhe Service Research Institute
www.ksri.kit.edu
44
Karlsruhe Service Research Institute
www.ksri.kit.edu
45
Karlsruhe Service Research Institute
www.ksri.kit.edu
46
Karlsruhe Service Research Institute
www.ksri.kit.edu
47
http://www.cs.cf.ac.uk/recognition/foursqexp
Karlsruhe Service Research Institute
www.ksri.kit.edu
48
Documentation
developer.foursquare.com
Karlsruhe Service Research Institute
www.ksri.kit.edu
49
Karlsruhe Service Research Institute
www.ksri.kit.edu
50
API Endpoints
http://api.foursquare.com/v2/
users/...
venues/...
checkins/...
lists/...
Karlsruhe Service Research Institute
www.ksri.kit.edu
51
Demo!
Karlsruhe Service Research Institute
www.ksri.kit.edu
facebook
52
Karlsruhe Service Research Institute
www.ksri.kit.edu
53
http://developers.facebook.com
Karlsruhe Service Research Institute
www.ksri.kit.edu
FB App Architecture
54
Karlsruhe Service Research Institute
www.ksri.kit.edu
Data Access Permissions
There are 79 data access permissions in FB in 3 categories:
§  User Data Permissions
§  Friend Data Permissions
§  Extended Permissions
§  They regulate what you can and
cannot access
55
Karlsruhe Service Research Institute
www.ksri.kit.edu
Permissions at glance
56
Karlsruhe Service Research Institute
www.ksri.kit.edu
FB JSON Objects
§  Everything in FB is accessed via an ID
§  Users, Pages, Events, Comments, Posts, Shares, …
§  To view / access the JSON object for a FB entity:
§  https://graph.facebook.com/<EntityID>?auth_token=<auth_token>
§  Auth Token? à Access Token
§  An access token is an opaque string that identifies a user, app, or page
and can be used by the app to make graph API calls.
§  It is valid only for a predetermined period of time
§  A log out action will automatically expire an access token
§  Every time you log into FB, you create an access token
§  More info:
§  http://developers.facebook.com/docs/facebook-login/access-tokens/
57
Karlsruhe Service Research Institute
www.ksri.kit.edu
https://graph.facebook.com/761705087?
auth_token=…
58
Karlsruhe Service Research Institute
www.ksri.kit.edu
and from php
59
Karlsruhe Service Research Institute
www.ksri.kit.edu
Beyond Basic Data
§  Add the fields argument, e.g.
https://graph.facebook.com/761705087?
fields=id,name,inbox&auth_token=…
$facebook->api("761705087?fields=id,name,inbox");
§  but, do something you don’t have permission for, and:
60
Karlsruhe Service Research Institute
www.ksri.kit.edu
61
https://developers.facebook.com/
tools/explorer
Karlsruhe Service Research Institute
www.ksri.kit.edu
62
Demo!
KIT – University of the State of Baden-Württemberg and
National Research Center of the Helmholtz Association
KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI)
www.kit.edu
Some Project Ideas
63
Karlsruhe Service Research Institute
www.ksri.kit.edu
Streaming API + Mapping
Monitor Trending Topics &
Influence Detection
Linguistic Analysis of Venue Tips in Karlsruhe
Heat Mapping of Venues
Render and Analyse a Social Graph
Linguistic Analysis of a Timeline /
Page etc.
Or A Combination Of The Lot
Karlsruhe Service Research Institute
www.ksri.kit.edu
Some useful libraries / resources
§  http://www.alchemyapi.com/ - Natural Language Processing
§  https://gephi.org/ - interactive graph visualisation and exploration
§  http://nodexl.codeplex.com/ - excel addon for graph analysis
(Windows only)
§  http://code.google.com/p/google-gson/ - JSON parser for Java
§  http://leafletjs.com/ - nice mapping API
§  https://github.com/pinzler/fsq-php-connectedapp - simple php
4sq app example
§  https://developer.foursquare.com/resources/libraries - Other 4sq
libraries
§  http://140dev.com/free-twitter-api-source-code-library/ - twitter
php server
§  https://dev.twitter.com/docs/twitter-libraries - Other twitter
libraries
65
Karlsruhe Service Research Institute
www.ksri.kit.edu

Más contenido relacionado

Similar a Social computing, Analysing Social Media: Theory and Hackathon

Synthetic data generation for machine learning
Synthetic data generation for machine learningSynthetic data generation for machine learning
Synthetic data generation for machine learning
QuantUniversity
 
#ALAAC15 Linked Data Love
#ALAAC15 Linked Data Love #ALAAC15 Linked Data Love
#ALAAC15 Linked Data Love
Kristi Holmes
 
Show and tell program 04 2014-09-04
Show and tell program 04 2014-09-04Show and tell program 04 2014-09-04
Show and tell program 04 2014-09-04
David Phillips
 

Similar a Social computing, Analysing Social Media: Theory and Hackathon (20)

GENI Engineering Conference -- Ian Foster
GENI Engineering Conference -- Ian FosterGENI Engineering Conference -- Ian Foster
GENI Engineering Conference -- Ian Foster
 
Synthetic data generation for machine learning
Synthetic data generation for machine learningSynthetic data generation for machine learning
Synthetic data generation for machine learning
 
Can’t Pay, Won’t Pay, Don’t Pay: Delivering open science, a Digital Research...
Can’t Pay, Won’t Pay, Don’t Pay: Delivering open science,  a Digital Research...Can’t Pay, Won’t Pay, Don’t Pay: Delivering open science,  a Digital Research...
Can’t Pay, Won’t Pay, Don’t Pay: Delivering open science, a Digital Research...
 
Deep learning - Part I
Deep learning - Part IDeep learning - Part I
Deep learning - Part I
 
CSS-Intro-Lecture.pdf
CSS-Intro-Lecture.pdfCSS-Intro-Lecture.pdf
CSS-Intro-Lecture.pdf
 
20171003 lancaster data conversations Chue-Hong
20171003 lancaster data conversations Chue-Hong20171003 lancaster data conversations Chue-Hong
20171003 lancaster data conversations Chue-Hong
 
#ALAAC15 Linked Data Love
#ALAAC15 Linked Data Love #ALAAC15 Linked Data Love
#ALAAC15 Linked Data Love
 
Building a Blockchain-based Reputation Infrastructure for Open Research. Ca...
  Building a Blockchain-based Reputation Infrastructure for Open Research. Ca...  Building a Blockchain-based Reputation Infrastructure for Open Research. Ca...
Building a Blockchain-based Reputation Infrastructure for Open Research. Ca...
 
Building a Blockchain-based Reputation Infrastructure for Open Research. Case...
Building a Blockchain-based Reputation Infrastructure for Open Research. Case...Building a Blockchain-based Reputation Infrastructure for Open Research. Case...
Building a Blockchain-based Reputation Infrastructure for Open Research. Case...
 
The API Jungle
The API JungleThe API Jungle
The API Jungle
 
Lightning Talk Session - Connecting Altmetric (K. Capretta)
Lightning Talk Session - Connecting Altmetric (K. Capretta)Lightning Talk Session - Connecting Altmetric (K. Capretta)
Lightning Talk Session - Connecting Altmetric (K. Capretta)
 
How to Cultivate Analytics Capabilities within an Organization? Design Option...
How to Cultivate Analytics Capabilities within an Organization? Design Option...How to Cultivate Analytics Capabilities within an Organization? Design Option...
How to Cultivate Analytics Capabilities within an Organization? Design Option...
 
Resume_Sreejith
Resume_SreejithResume_Sreejith
Resume_Sreejith
 
QuSandbox+NVIDIA Rapids
QuSandbox+NVIDIA RapidsQuSandbox+NVIDIA Rapids
QuSandbox+NVIDIA Rapids
 
SGCI OAC webinar 4 18-19
SGCI OAC webinar 4 18-19SGCI OAC webinar 4 18-19
SGCI OAC webinar 4 18-19
 
Materi Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHPMateri Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHP
 
Citizen-centric Linked Data Services for Smarter Cities
Citizen-centric Linked Data Services for Smarter CitiesCitizen-centric Linked Data Services for Smarter Cities
Citizen-centric Linked Data Services for Smarter Cities
 
Show and tell program 04 2014-09-04
Show and tell program 04 2014-09-04Show and tell program 04 2014-09-04
Show and tell program 04 2014-09-04
 
How Open Source Is Shaping Quality Engineering
How Open Source Is Shaping Quality EngineeringHow Open Source Is Shaping Quality Engineering
How Open Source Is Shaping Quality Engineering
 
H2O Overview with Amy Wang at useR! Aalborg
H2O Overview with Amy Wang at useR! AalborgH2O Overview with Amy Wang at useR! Aalborg
H2O Overview with Amy Wang at useR! Aalborg
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Social computing, Analysing Social Media: Theory and Hackathon

  • 1. KIT – University of the State of Baden-Württemberg and National Research Center of the Helmholtz Association KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI) www.kit.edu Social Computing Analysing Social Media: Theory and Hackathon Dr. Simon Caton and Dr. Martin Chorley
  • 2. Karlsruhe Service Research Institute www.ksri.kit.edu About us Simon §  PostDoc @KIT §  CS PhD @Cardiff University §  Working on / with: Martin §  PostDoc @Cardiff University §  CS PhD @Cardiff University §  Working on / with:
  • 3. Karlsruhe Service Research Institute www.ksri.kit.edu Agenda 1330 – 1500 Intro, Social Media Analysis, Team Formation 1530 – 1615: Project Brainstorming + Machine Setup 1615 – 1900: Implementation Session I 1900 – 2000: Dinner on the go 2000 – 2200: Implementation Session II 2200+: Debrief + Informal Get Together 1700 – 1730 (Tomorrow) Demos and Winner Selection 3
  • 4. KIT – University of the State of Baden-Württemberg and National Research Center of the Helmholtz Association KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI) www.kit.edu Social Computing: Brief Overview
  • 5. Karlsruhe Service Research Institute www.ksri.kit.edu Social Computing? §  “…any type of computing application in which software serves as an intermediary or a focus for a social relation” D. Schuler, Social Computing, CACM, 37(1) 1994. §  “A social structure in which technology puts power in individuals and communities, not institutions” C. Charron, J. Favier, and C. Li, Social Computing: How Networks Erode Institutional Power, and What to Do about It, Forrester Customer Report, 2006. §  “Computational facilitation of social studies and human social dynamics as well as the design and use of ICT that consider social context” F.-Y. Wang, D. Zeng, K. Carley, W. Mao, “Social Computing: From Social Informatics to Social Intelligence”, IEEE Intelligent Systems, 2, 2007. 5
  • 6. Karlsruhe Service Research Institute www.ksri.kit.edu Main Social Computing Domains 6 Giuseppe Lugano. Social Computing: A Classification of Existing Paradigms. IEEE Social Computing 2012
  • 7. Karlsruhe Service Research Institute www.ksri.kit.edu 7
  • 8. Karlsruhe Service Research Institute www.ksri.kit.edu 8
  • 9. Karlsruhe Service Research Institute www.ksri.kit.edu 9
  • 10. Karlsruhe Service Research Institute www.ksri.kit.edu What we are going to look at 10 Foundations Social Media Platforms
  • 11. Karlsruhe Service Research Institute www.ksri.kit.edu Learning Outcomes of the Session §  to learn the basics of analysing social media via a hands on session with Facebook, Twitter or Foursquare §  to gain hands on experience of accessing data, creating apps and running analysis methods §  to gain experience in team-based rapid prototyping 11
  • 12. Karlsruhe Service Research Institute www.ksri.kit.edu How this will work Choose Create teams: . 12
  • 13. KIT – University of the State of Baden-Württemberg and National Research Center of the Helmholtz Association KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI) www.kit.edu Social Media Analysis Crash Course: JSON, Twitter, Foursquare, and Facebook 13
  • 14. Karlsruhe Service Research Institute www.ksri.kit.edu A P I pplication rogramming nterface
  • 15. Karlsruhe Service Research Institute www.ksri.kit.edu 15 Server Server Server Server http request json response REST API
  • 16. Karlsruhe Service Research Institute www.ksri.kit.edu 16 client-server stateless cacheable layered uniform interface
  • 17. Karlsruhe Service Research Institute www.ksri.kit.edu 17 GET PUT POST DELETE
  • 18. Karlsruhe Service Research Institute www.ksri.kit.edu 18 J S O N ava cript bject otation
  • 19. Karlsruhe Service Research Institute www.ksri.kit.edu 19
  • 20. Karlsruhe Service Research Institute www.ksri.kit.edu 20 }string{ value: , ][ value , objects: arrays:
  • 21. Karlsruhe Service Research Institute www.ksri.kit.edu 21 values:string number object array true false null
  • 22. Karlsruhe Service Research Institute www.ksri.kit.edu 22
  • 23. Karlsruhe Service Research Institute www.ksri.kit.edu 23
  • 24. Karlsruhe Service Research Institute www.ksri.kit.edu 24 How does the API know who we are?
  • 25. Karlsruhe Service Research Institute www.ksri.kit.edu 25 How do we know who the user is?
  • 26. Karlsruhe Service Research Institute www.ksri.kit.edu 26 How does the service know we can access data?
  • 27. Karlsruhe Service Research Institute www.ksri.kit.edu 27 OAuth 1. identification 2. authentication 3. access to data
  • 28. Karlsruhe Service Research Institute www.ksri.kit.edu 28 user app api provider user requests login redirectuser api provider confirms identity user grants permission accesskey
  • 29. Karlsruhe Service Research Institute www.ksri.kit.edu 29 Twitter
  • 30. Karlsruhe Service Research Institute www.ksri.kit.edu 30
  • 31. Karlsruhe Service Research Institute www.ksri.kit.edu 31
  • 32. Karlsruhe Service Research Institute www.ksri.kit.edu 32 Documentation dev.twitter.com
  • 33. Karlsruhe Service Research Institute www.ksri.kit.edu 33
  • 34. Karlsruhe Service Research Institute www.ksri.kit.edu 34 REST API Streaming API vs.
  • 35. Karlsruhe Service Research Institute www.ksri.kit.edu 35 Server http request json response REST API
  • 36. Karlsruhe Service Research Institute www.ksri.kit.edu 36 API Endpoints https://api.twitter.com/1.1 statuses/... users/... search/... lists/...
  • 37. Karlsruhe Service Research Institute www.ksri.kit.edu 37 Server http request tweet Streaming API tweet tweet ... connection closes
  • 38. Karlsruhe Service Research Institute www.ksri.kit.edu 38 Streaming API https://stream.twitter.com/1.1/ statuses/filter.json
  • 39. Karlsruhe Service Research Institute www.ksri.kit.edu 39 Demo!
  • 40. Karlsruhe Service Research Institute www.ksri.kit.edu 40
  • 41. Karlsruhe Service Research Institute www.ksri.kit.edu 41
  • 42. Karlsruhe Service Research Institute www.ksri.kit.edu 42
  • 43. Karlsruhe Service Research Institute www.ksri.kit.edu 43
  • 44. Karlsruhe Service Research Institute www.ksri.kit.edu 44
  • 45. Karlsruhe Service Research Institute www.ksri.kit.edu 45
  • 46. Karlsruhe Service Research Institute www.ksri.kit.edu 46
  • 47. Karlsruhe Service Research Institute www.ksri.kit.edu 47 http://www.cs.cf.ac.uk/recognition/foursqexp
  • 48. Karlsruhe Service Research Institute www.ksri.kit.edu 48 Documentation developer.foursquare.com
  • 49. Karlsruhe Service Research Institute www.ksri.kit.edu 49
  • 50. Karlsruhe Service Research Institute www.ksri.kit.edu 50 API Endpoints http://api.foursquare.com/v2/ users/... venues/... checkins/... lists/...
  • 51. Karlsruhe Service Research Institute www.ksri.kit.edu 51 Demo!
  • 52. Karlsruhe Service Research Institute www.ksri.kit.edu facebook 52
  • 53. Karlsruhe Service Research Institute www.ksri.kit.edu 53 http://developers.facebook.com
  • 54. Karlsruhe Service Research Institute www.ksri.kit.edu FB App Architecture 54
  • 55. Karlsruhe Service Research Institute www.ksri.kit.edu Data Access Permissions There are 79 data access permissions in FB in 3 categories: §  User Data Permissions §  Friend Data Permissions §  Extended Permissions §  They regulate what you can and cannot access 55
  • 56. Karlsruhe Service Research Institute www.ksri.kit.edu Permissions at glance 56
  • 57. Karlsruhe Service Research Institute www.ksri.kit.edu FB JSON Objects §  Everything in FB is accessed via an ID §  Users, Pages, Events, Comments, Posts, Shares, … §  To view / access the JSON object for a FB entity: §  https://graph.facebook.com/<EntityID>?auth_token=<auth_token> §  Auth Token? à Access Token §  An access token is an opaque string that identifies a user, app, or page and can be used by the app to make graph API calls. §  It is valid only for a predetermined period of time §  A log out action will automatically expire an access token §  Every time you log into FB, you create an access token §  More info: §  http://developers.facebook.com/docs/facebook-login/access-tokens/ 57
  • 58. Karlsruhe Service Research Institute www.ksri.kit.edu https://graph.facebook.com/761705087? auth_token=… 58
  • 59. Karlsruhe Service Research Institute www.ksri.kit.edu and from php 59
  • 60. Karlsruhe Service Research Institute www.ksri.kit.edu Beyond Basic Data §  Add the fields argument, e.g. https://graph.facebook.com/761705087? fields=id,name,inbox&auth_token=… $facebook->api("761705087?fields=id,name,inbox"); §  but, do something you don’t have permission for, and: 60
  • 61. Karlsruhe Service Research Institute www.ksri.kit.edu 61 https://developers.facebook.com/ tools/explorer
  • 62. Karlsruhe Service Research Institute www.ksri.kit.edu 62 Demo!
  • 63. KIT – University of the State of Baden-Württemberg and National Research Center of the Helmholtz Association KARLSRUHE SERVICE RESEARCH INSTITUTE (KSRI) www.kit.edu Some Project Ideas 63
  • 64. Karlsruhe Service Research Institute www.ksri.kit.edu Streaming API + Mapping Monitor Trending Topics & Influence Detection Linguistic Analysis of Venue Tips in Karlsruhe Heat Mapping of Venues Render and Analyse a Social Graph Linguistic Analysis of a Timeline / Page etc. Or A Combination Of The Lot
  • 65. Karlsruhe Service Research Institute www.ksri.kit.edu Some useful libraries / resources §  http://www.alchemyapi.com/ - Natural Language Processing §  https://gephi.org/ - interactive graph visualisation and exploration §  http://nodexl.codeplex.com/ - excel addon for graph analysis (Windows only) §  http://code.google.com/p/google-gson/ - JSON parser for Java §  http://leafletjs.com/ - nice mapping API §  https://github.com/pinzler/fsq-php-connectedapp - simple php 4sq app example §  https://developer.foursquare.com/resources/libraries - Other 4sq libraries §  http://140dev.com/free-twitter-api-source-code-library/ - twitter php server §  https://dev.twitter.com/docs/twitter-libraries - Other twitter libraries 65
  • 66. Karlsruhe Service Research Institute www.ksri.kit.edu