SlideShare a Scribd company logo
Introduction to Facebook Python API
Social Network and Applications, 2011
LittleQ, The Department of Computer Science, NCCU




                                                    f
                                                         Introduction to
                                                        Facebook PY API
Objectives



•   Learn the concepts of Facebook API
•   Learn how to play with Facebook Graph
    API


                                     f
                                          Introduction to
                                         Facebook PY API
Core Topics

•   Facebook Developers website
•   Graph API
•   Facebook Python SDK
•   Resources



                                  f
                                       Introduction to
                                      Facebook PY API
Facebook Developers

•   Provide you online documentations
•   Forum for discussion
•   Management of your applications




                                      f
                                           Introduction to
                                          Facebook PY API
Where is it?




               f
                    Introduction to
                   Facebook PY API
Social Plugins


•   Like Button, Send Button, Login Button
•   Comments
•   Your Friends
•   Activity Feed, Live Stream

                                     f
                                          Introduction to
                                         Facebook PY API
Is That What You Want?



                  f
                       Introduction to
                      Facebook PY API
Graph API
              Response Data               Aggregate Information




              Access Token                    Request Data



Application                   Graph API                      Facebook Database


 •   Facebook’s core
 •   Social graph
 •   Connections


                                                                  f
                                                                       Introduction to
                                                                      Facebook PY API
Graph Model

•   Composed of objects and connections
•   Identify entities and relationships by id
•   Data will be stored with smallest spaces
    and keep being updated




                                        f
                                             Introduction to
                                            Facebook PY API
Object Model

information from graph API
   without access token




                               f
                                    Introduction to
                                   Facebook PY API
Graph Model
          information from graph API
               with access token




                f
                      Introduction to
                     Facebook PY API
Connection Model

•   All of the object in the Facebook social graph are connected
    to each other via connections

•   Objects are just like entities while connections are like
    relationship

•   For example, users, pages and groups are objects and likes,
    friends and feeds are connections




                                                       f
                                                            Introduction to
                                                           Facebook PY API
Connection Model




              f
                   Introduction to
                  Facebook PY API
Access to Graph
•   HTTP(S) Graph API
•   SDKs
    ‣   Javascript SDK

    ‣   iOS SDK

    ‣   Android SDK

    ‣   PHP SDK

    ‣   Python SDK




                         f
                              Introduction to
                             Facebook PY API
HTTP(S) Graph API

•   RESTful HTTP request & response
•   Response data-type: JSON
•   Access URL: graph.facebook.com




                                      f
                                           Introduction to
                                          Facebook PY API
HTTP(S) Graph API

http://graph.facebook.com/<id-­‐or-­‐username>



•   Request information of an object with id or username

•   id-or-username can be “me” with the access token




                                                f
                                                        Introduction to
                                                       Facebook PY API
HTTP(S) Graph API
           http://graph.facebook.com/littleq0903


Result:
    {
    	
  	
  	
  "id":	
  "1681390745",
    	
  	
  	
  "name":	
  "Colin	
  Su",
    	
  	
  	
  "first_name":	
  "Colin",
    	
  	
  	
  "last_name":	
  "Su",
    	
  	
  	
  "link":	
  "https://www.facebook.com/littleq0903",
    	
  	
  	
  "username":	
  "littleq0903",
    	
  	
  	
  "gender":	
  "male",
    	
  	
  	
  "locale":	
  "en_US"
    }



                                                             f
                                                                      Introduction to
                                                                     Facebook PY API
Access Token
•   A long string stands for the authentication of users

•   Temporary

•   The information behind the access token

    ‣ user id
    ‣ app id
    ‣ expired time
    ‣ secret


                                                  f
                                                       Introduction to
                                                      Facebook PY API
Get Access Token

•   GetMyAccess
    http://getmyaccess.heroku.com
•   It requires a permission called
    “offline_access”, so this token can be valid
    for a long time



                                       f
                                            Introduction to
                                           Facebook PY API
HTTP(S) Graph API

•   Access token should be transferred as a
    HTTP GET variable
http://graph.facebook.com/littleq0903?access_token=...


•   More information:
    developers.facebook.com/docs/reference/
    api/


                                              f
                                                   Introduction to
                                                  Facebook PY API
Python SDK



•   Let you access all features of the Graph API
•   That’s all, let’s play!


                                       f
                                            Introduction to
                                           Facebook PY API
Python SDK


•   https://github.com/facebook/python-sdk
•   Designed to support Graph API and FB
    Javascript SDK (You will learn in the future)




                                        f
                                             Introduction to
                                            Facebook PY API
Graph


•   Depends your access token
•   Everyone will have their own graph, could
    be unique




                                     f
                                          Introduction to
                                         Facebook PY API
Graph API Class
•   Fetch the graph by implement it


    import	
  facebook

    graph	
  =	
  facebook.GraphAPI()
    user	
  =	
  graph.get_object(“littleq0903”)




                                                   f
                                                        Introduction to
                                                       Facebook PY API
Authentication
       my_profile	
  =	
  graph.get_object(“me”)


•   Graph can be implemented with an access
    token

          graph	
  =	
  GraphAPI(ACCESS_TOKEN)



•   And the perspective of the graph will be
    different

                                                 f
                                                      Introduction to
                                                     Facebook PY API
Graph Methods

•   get_object, get_objects
•   get_connections
•   put_object
•   put_wall_post, put_comment, put_like
•   delete_object


                                    f
                                         Introduction to
                                        Facebook PY API
Demo



       f
            Introduction to
           Facebook PY API
Homework

•   Fetch a kind of data on the FB Graph
•   Do some statistics on it
•   Don’t Copy from others




                                      f
                                            Introduction to
                                           Facebook PY API
Q&A Time
Thanks for your listening



                            f
                                 Introduction to
                                Facebook PY API

More Related Content

What's hot

Facebook api
Facebook api Facebook api
Facebook api
snipermkd
 
Facebook API for iOS
Facebook API for iOSFacebook API for iOS
Facebook API for iOS
Hidetoshi Mori
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
Pitra Satvika
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introductionh_marvin
 
Download PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering studentsDownload PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering students
SkyingBlogger
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integration
mujahidslideshare
 
Creating a Facebook App
Creating a Facebook AppCreating a Facebook App
Creating a Facebook App
Mindgrub Technologies
 
A Guide Social Media Platforms
A Guide Social Media PlatformsA Guide Social Media Platforms
A Guide Social Media Platforms
authors boards
 
Web 2 0 Search Engine Optimization Manual
Web 2 0 Search Engine Optimization ManualWeb 2 0 Search Engine Optimization Manual
Web 2 0 Search Engine Optimization Manualfemi adi
 
Facebook Dorkbot
Facebook DorkbotFacebook Dorkbot
Facebook Dorkbot
Vivien Schilis
 
New Media Tools In The Newsroom A Beginners Guide 12
New Media Tools In The Newsroom A Beginners Guide 12New Media Tools In The Newsroom A Beginners Guide 12
New Media Tools In The Newsroom A Beginners Guide 12femi adi
 

What's hot (12)

Facebook api
Facebook api Facebook api
Facebook api
 
Facebook API for iOS
Facebook API for iOSFacebook API for iOS
Facebook API for iOS
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
 
Download PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering studentsDownload PowerPoint Project on social programming for engineering students
Download PowerPoint Project on social programming for engineering students
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integration
 
Creating a Facebook App
Creating a Facebook AppCreating a Facebook App
Creating a Facebook App
 
A Guide Social Media Platforms
A Guide Social Media PlatformsA Guide Social Media Platforms
A Guide Social Media Platforms
 
Web 2 0 Search Engine Optimization Manual
Web 2 0 Search Engine Optimization ManualWeb 2 0 Search Engine Optimization Manual
Web 2 0 Search Engine Optimization Manual
 
Pr7 8 clubwear-and-party-wear
Pr7 8 clubwear-and-party-wearPr7 8 clubwear-and-party-wear
Pr7 8 clubwear-and-party-wear
 
Facebook Dorkbot
Facebook DorkbotFacebook Dorkbot
Facebook Dorkbot
 
New Media Tools In The Newsroom A Beginners Guide 12
New Media Tools In The Newsroom A Beginners Guide 12New Media Tools In The Newsroom A Beginners Guide 12
New Media Tools In The Newsroom A Beginners Guide 12
 

Viewers also liked

Python at Facebook
Python at FacebookPython at Facebook
Python at Facebook
Angelo Failla
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK
Colin Su
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Python
didip
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability Mistakes
John Coggeshall
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for Beginners
Jesse Stay
 
RDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_CloudRDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_CloudRaminder Singh
 
Python games
Python gamesPython games
Python games
dxbeeh
 
Introduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The InstitutionIntroduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The Institution
lisbk
 
introduction to server-side scripting
introduction to server-side scriptingintroduction to server-side scripting
introduction to server-side scripting
Amirul Shafeeq
 
Why APIs? Why API Management? Michel dorochevsky - Introduction-API-Managemet
Why APIs? Why API Management? Michel dorochevsky - Introduction-API-ManagemetWhy APIs? Why API Management? Michel dorochevsky - Introduction-API-Managemet
Why APIs? Why API Management? Michel dorochevsky - Introduction-API-Managemet
CA API Management
 
Server and Client side comparision
Server and Client side comparisionServer and Client side comparision
Server and Client side comparision
Stew Duncan
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK
Dimitar Danailov
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1
Abhishek Mishra
 
Website vs web app
Website vs web appWebsite vs web app
Website vs web app
Immortal Technologies
 
Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...
Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...
Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...
AllFacebook.de
 
An Introduction to the WSO2 API Manager
An Introduction to the WSO2 API Manager An Introduction to the WSO2 API Manager
An Introduction to the WSO2 API Manager WSO2
 
API designing with WSO2 API Manager
API designing with WSO2 API ManagerAPI designing with WSO2 API Manager
API designing with WSO2 API Manager
WSO2
 
API-Industrie
API-IndustrieAPI-Industrie
API-Industrie
kspichale
 
Mobile app Vs Web App
Mobile app Vs Web AppMobile app Vs Web App
Mobile app Vs Web App
Htain Lin Shwe
 
WSO2 API Manager 2.0 - Overview
WSO2 API Manager 2.0 - Overview WSO2 API Manager 2.0 - Overview
WSO2 API Manager 2.0 - Overview
Edgar Silva
 

Viewers also liked (20)

Python at Facebook
Python at FacebookPython at Facebook
Python at Facebook
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK
 
Super Sizing Youtube with Python
Super Sizing Youtube with PythonSuper Sizing Youtube with Python
Super Sizing Youtube with Python
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability Mistakes
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for Beginners
 
RDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_CloudRDS_Photoscan_Eval_Cloud
RDS_Photoscan_Eval_Cloud
 
Python games
Python gamesPython games
Python games
 
Introduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The InstitutionIntroduction To Facebook: Opportunities and Challenges For The Institution
Introduction To Facebook: Opportunities and Challenges For The Institution
 
introduction to server-side scripting
introduction to server-side scriptingintroduction to server-side scripting
introduction to server-side scripting
 
Why APIs? Why API Management? Michel dorochevsky - Introduction-API-Managemet
Why APIs? Why API Management? Michel dorochevsky - Introduction-API-ManagemetWhy APIs? Why API Management? Michel dorochevsky - Introduction-API-Managemet
Why APIs? Why API Management? Michel dorochevsky - Introduction-API-Managemet
 
Server and Client side comparision
Server and Client side comparisionServer and Client side comparision
Server and Client side comparision
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1
 
Website vs web app
Website vs web appWebsite vs web app
Website vs web app
 
Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...
Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...
Facebook ist tot. Eine Obduktion in sieben Akten. @ AllFacebook Marketing Con...
 
An Introduction to the WSO2 API Manager
An Introduction to the WSO2 API Manager An Introduction to the WSO2 API Manager
An Introduction to the WSO2 API Manager
 
API designing with WSO2 API Manager
API designing with WSO2 API ManagerAPI designing with WSO2 API Manager
API designing with WSO2 API Manager
 
API-Industrie
API-IndustrieAPI-Industrie
API-Industrie
 
Mobile app Vs Web App
Mobile app Vs Web AppMobile app Vs Web App
Mobile app Vs Web App
 
WSO2 API Manager 2.0 - Overview
WSO2 API Manager 2.0 - Overview WSO2 API Manager 2.0 - Overview
WSO2 API Manager 2.0 - Overview
 

Similar to Facebook Python SDK - Introduction

Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
Chris Busse
 
20110611 Facebook Case Study
20110611 Facebook Case Study20110611 Facebook Case Study
20110611 Facebook Case Study
Yuki MAEJIMA
 
20140505 - Victor Gau - R to access the social graph from facebook
20140505 - Victor Gau - R to access the social graph from facebook20140505 - Victor Gau - R to access the social graph from facebook
20140505 - Victor Gau - R to access the social graph from facebook
Victor Gau
 
An introduction to mixi Graph API
An introduction to mixi Graph APIAn introduction to mixi Graph API
An introduction to mixi Graph APImixiplatform
 

Similar to Facebook Python SDK - Introduction (6)

Facebook api for iOS
Facebook api for iOSFacebook api for iOS
Facebook api for iOS
 
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
Facebook Open Graph Protocol and Graph API (NoVA Code Camp 2010.1)
 
20110611 Facebook Case Study
20110611 Facebook Case Study20110611 Facebook Case Study
20110611 Facebook Case Study
 
20140505 - Victor Gau - R to access the social graph from facebook
20140505 - Victor Gau - R to access the social graph from facebook20140505 - Victor Gau - R to access the social graph from facebook
20140505 - Victor Gau - R to access the social graph from facebook
 
An introduction to mixi Graph API
An introduction to mixi Graph APIAn introduction to mixi Graph API
An introduction to mixi Graph API
 
MTSW-Facebook-1
MTSW-Facebook-1MTSW-Facebook-1
MTSW-Facebook-1
 

More from Colin Su

Introduction to Google Compute Engine
Introduction to Google Compute EngineIntroduction to Google Compute Engine
Introduction to Google Compute EngineColin Su
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Colin Su
 
Functional programming in Python
Functional programming in PythonFunctional programming in Python
Functional programming in PythonColin Su
 
Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code LabColin Su
 
A Tour of Google Cloud Platform
A Tour of Google Cloud PlatformA Tour of Google Cloud Platform
A Tour of Google Cloud Platform
Colin Su
 
Introduction to MapReduce & hadoop
Introduction to MapReduce & hadoopIntroduction to MapReduce & hadoop
Introduction to MapReduce & hadoop
Colin Su
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
Colin Su
 
Django Deployer
Django DeployerDjango Deployer
Django Deployer
Colin Su
 
Introduction to Google - the most natural way to learn English (English Speech)
Introduction to Google - the most natural way to learn English (English Speech)Introduction to Google - the most natural way to learn English (English Speech)
Introduction to Google - the most natural way to learn English (English Speech)
Colin Su
 
How to Speak Charms Like a Wizard
How to Speak Charms Like a WizardHow to Speak Charms Like a Wizard
How to Speak Charms Like a WizardColin Su
 
房地產報告
房地產報告房地產報告
房地產報告Colin Su
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Colin Su
 
Web Programming - 1st TA Session
Web Programming - 1st TA SessionWeb Programming - 1st TA Session
Web Programming - 1st TA Session
Colin Su
 
Nested List Comprehension and Binary Search
Nested List Comprehension and Binary SearchNested List Comprehension and Binary Search
Nested List Comprehension and Binary Search
Colin Su
 
Python-List comprehension
Python-List comprehensionPython-List comprehension
Python-List comprehension
Colin Su
 
Python-FileIO
Python-FileIOPython-FileIO
Python-FileIO
Colin Su
 
Python Dictionary
Python DictionaryPython Dictionary
Python Dictionary
Colin Su
 
Vim editor
Vim editorVim editor
Vim editor
Colin Su
 
VPython introduction
VPython introductionVPython introduction
VPython introduction
Colin Su
 
Linux-Permission
Linux-PermissionLinux-Permission
Linux-Permission
Colin Su
 

More from Colin Su (20)

Introduction to Google Compute Engine
Introduction to Google Compute EngineIntroduction to Google Compute Engine
Introduction to Google Compute Engine
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API Development
 
Functional programming in Python
Functional programming in PythonFunctional programming in Python
Functional programming in Python
 
Web2py Code Lab
Web2py Code LabWeb2py Code Lab
Web2py Code Lab
 
A Tour of Google Cloud Platform
A Tour of Google Cloud PlatformA Tour of Google Cloud Platform
A Tour of Google Cloud Platform
 
Introduction to MapReduce & hadoop
Introduction to MapReduce & hadoopIntroduction to MapReduce & hadoop
Introduction to MapReduce & hadoop
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
 
Django Deployer
Django DeployerDjango Deployer
Django Deployer
 
Introduction to Google - the most natural way to learn English (English Speech)
Introduction to Google - the most natural way to learn English (English Speech)Introduction to Google - the most natural way to learn English (English Speech)
Introduction to Google - the most natural way to learn English (English Speech)
 
How to Speak Charms Like a Wizard
How to Speak Charms Like a WizardHow to Speak Charms Like a Wizard
How to Speak Charms Like a Wizard
 
房地產報告
房地產報告房地產報告
房地產報告
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Web Programming - 1st TA Session
Web Programming - 1st TA SessionWeb Programming - 1st TA Session
Web Programming - 1st TA Session
 
Nested List Comprehension and Binary Search
Nested List Comprehension and Binary SearchNested List Comprehension and Binary Search
Nested List Comprehension and Binary Search
 
Python-List comprehension
Python-List comprehensionPython-List comprehension
Python-List comprehension
 
Python-FileIO
Python-FileIOPython-FileIO
Python-FileIO
 
Python Dictionary
Python DictionaryPython Dictionary
Python Dictionary
 
Vim editor
Vim editorVim editor
Vim editor
 
VPython introduction
VPython introductionVPython introduction
VPython introduction
 
Linux-Permission
Linux-PermissionLinux-Permission
Linux-Permission
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 

Facebook Python SDK - Introduction

  • 1. Introduction to Facebook Python API Social Network and Applications, 2011 LittleQ, The Department of Computer Science, NCCU f Introduction to Facebook PY API
  • 2. Objectives • Learn the concepts of Facebook API • Learn how to play with Facebook Graph API f Introduction to Facebook PY API
  • 3. Core Topics • Facebook Developers website • Graph API • Facebook Python SDK • Resources f Introduction to Facebook PY API
  • 4. Facebook Developers • Provide you online documentations • Forum for discussion • Management of your applications f Introduction to Facebook PY API
  • 5. Where is it? f Introduction to Facebook PY API
  • 6. Social Plugins • Like Button, Send Button, Login Button • Comments • Your Friends • Activity Feed, Live Stream f Introduction to Facebook PY API
  • 7. Is That What You Want? f Introduction to Facebook PY API
  • 8. Graph API Response Data Aggregate Information Access Token Request Data Application Graph API Facebook Database • Facebook’s core • Social graph • Connections f Introduction to Facebook PY API
  • 9. Graph Model • Composed of objects and connections • Identify entities and relationships by id • Data will be stored with smallest spaces and keep being updated f Introduction to Facebook PY API
  • 10. Object Model information from graph API without access token f Introduction to Facebook PY API
  • 11. Graph Model information from graph API with access token f Introduction to Facebook PY API
  • 12. Connection Model • All of the object in the Facebook social graph are connected to each other via connections • Objects are just like entities while connections are like relationship • For example, users, pages and groups are objects and likes, friends and feeds are connections f Introduction to Facebook PY API
  • 13. Connection Model f Introduction to Facebook PY API
  • 14. Access to Graph • HTTP(S) Graph API • SDKs ‣ Javascript SDK ‣ iOS SDK ‣ Android SDK ‣ PHP SDK ‣ Python SDK f Introduction to Facebook PY API
  • 15. HTTP(S) Graph API • RESTful HTTP request & response • Response data-type: JSON • Access URL: graph.facebook.com f Introduction to Facebook PY API
  • 16. HTTP(S) Graph API http://graph.facebook.com/<id-­‐or-­‐username> • Request information of an object with id or username • id-or-username can be “me” with the access token f Introduction to Facebook PY API
  • 17. HTTP(S) Graph API http://graph.facebook.com/littleq0903 Result: {      "id":  "1681390745",      "name":  "Colin  Su",      "first_name":  "Colin",      "last_name":  "Su",      "link":  "https://www.facebook.com/littleq0903",      "username":  "littleq0903",      "gender":  "male",      "locale":  "en_US" } f Introduction to Facebook PY API
  • 18. Access Token • A long string stands for the authentication of users • Temporary • The information behind the access token ‣ user id ‣ app id ‣ expired time ‣ secret f Introduction to Facebook PY API
  • 19. Get Access Token • GetMyAccess http://getmyaccess.heroku.com • It requires a permission called “offline_access”, so this token can be valid for a long time f Introduction to Facebook PY API
  • 20. HTTP(S) Graph API • Access token should be transferred as a HTTP GET variable http://graph.facebook.com/littleq0903?access_token=... • More information: developers.facebook.com/docs/reference/ api/ f Introduction to Facebook PY API
  • 21. Python SDK • Let you access all features of the Graph API • That’s all, let’s play! f Introduction to Facebook PY API
  • 22. Python SDK • https://github.com/facebook/python-sdk • Designed to support Graph API and FB Javascript SDK (You will learn in the future) f Introduction to Facebook PY API
  • 23. Graph • Depends your access token • Everyone will have their own graph, could be unique f Introduction to Facebook PY API
  • 24. Graph API Class • Fetch the graph by implement it import  facebook graph  =  facebook.GraphAPI() user  =  graph.get_object(“littleq0903”) f Introduction to Facebook PY API
  • 25. Authentication my_profile  =  graph.get_object(“me”) • Graph can be implemented with an access token graph  =  GraphAPI(ACCESS_TOKEN) • And the perspective of the graph will be different f Introduction to Facebook PY API
  • 26. Graph Methods • get_object, get_objects • get_connections • put_object • put_wall_post, put_comment, put_like • delete_object f Introduction to Facebook PY API
  • 27. Demo f Introduction to Facebook PY API
  • 28. Homework • Fetch a kind of data on the FB Graph • Do some statistics on it • Don’t Copy from others f Introduction to Facebook PY API
  • 29. Q&A Time Thanks for your listening f Introduction to Facebook PY API