SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Tích hợp trao đổi dữ liệu với
        Facebook




      By: Nguyễn Mạnh Tiến
            Tầm tay
Agenda

•   FB connection
•   FB graph API
•   How work?
•   Technical steps
•   FB and Open Social
Facebook overview
About 400 million monthly
  active users
About 60 million Connect users
About 83% people trust their
  friends over any other
  source.
About 36 TB/day
Facebook connection?

●   The next evolution of Facebook Platform

● It enables the integration of the Facebook Platform into your own site, allowing
   your users to:
– Seamlessly "connect" their Facebook account and
information with your site
– Connect and find their friends who also use your site
– Share information and actions on your site with their
friends on Facebook through their profile pages &
newsfeeds
Facebook to my site?


• Identity: Seamlessly connect the user's Facebook account and
information with your site.
• Friends: Bring a user's Facebook friends into your site. You can
even link friends that have existing accounts.
• Discovery: Publish information back into their friends' News
Feeds on Facebook.
• Privacy: Bring dynamic privacy to your site.
• Reliability: The full power and flexibility of Facebook
Platform.
Should Use Facebook Connect?

• One-click Login: Allow users to log in with their Facebook identity and
allow your site to access their Facebook profile information.

• Increased engagement: Leverage users' personal interests to show more
relevant information and surface personalized content from friends such
as reviews or comments.

• New forms of distribution: Users can share content and actions taken on
your site with friends back on Facebook through feed, invites, and other
social communication channels on Facebook.
Facebook core
Facebook Graph API?

– Facebook's core
– Presents a simple, consistent view of the Facebook
    social graph
– Every object in the social graph has a unique ID. You
    can access the properties of an object by requesting
    https://graph.facebook.com/ID
– People and pages with usernames can be accessed
    using their username as an ID
– All responses are JSON objects
– Relationships
– Reading, Searching, Publishing, Deleting, Analytics
Object
https://graph.facebook.com/platform
Relationships
https://graph.facebook.com/ID/CONNECTION_TYPE
How does it work?
Connect
Interactive with Facebook
Technical steps
First step


• Yêu cầu chung: YOUR_APP_ID
• đăng ký với FB để lấy mã ID tương tác với ứng dụng của FB
     (FaceBook API)
• http://developers.facebook.com/setup/
Next step : Authentication

    Authenticate on your site (out of FB). Method of authentication :
in code - server side : The server-side flow is used whenever you need to call the
    Graph API from your web server
in html - client side : The client-side flow is used when you need to make calls to
    the Graph API from a client, such as JavaScript running in a Web browser or
    from a native mobile or desktop app

    Iusse request :
https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream

    Return code to get access token key:
Kết thúc Authentication thì FB sẽ trả về code để lấy token code và access vào
   graph protocol của FB để lấy các loại dữ liệu khác
nguồn tham khảo : http://developers.facebook.com/docs/authentication
Reading
Using access token key, issuing HTTP GET requests , return data in json
ví dụ truy cập feed :
https://graph.facebook.com/id/feed?access_token=2227470867|2.AQA_W4-
    fDdlG-erj.3600.1306126800.0-1090002606|Ktp_XdsULJo0j-CAaUratCxJKqM


Php code:
<?php
$readfeed_url = sprintf('https://graph.facebook.com/%d/feed?access_token=%s',
   $fbdata['fbid'], $fbdata['access_token'] ) ;
$feed = json_decode(file_get_contents($readfeed_url));
?>
Publishing
Using access token key: issuing HTTP POST requests




Php code tương ứng :
<?php
$token = 3523452345.....
$message = "Hello, Arjun. I like this new API";
$uid = arjun
$url = https://graph.facebook.com/$uid/feed?
   access_token=$token&message=$message&method=post
$result = file_get_contents($url);
?>
Alternatively, OpenSocial
Market Size and Competition
•   Ideally speaking, OpenSocial has
    a market potential for 250 million
    users as opposed to 64 million
    active users on Facebook

•   15,000 Applications on Facebook.
    Difficult to rapidly grow user base
    due to a saturated market

•   Most existing Google Widgets can
    run on OpenSocial. Results?
    Difficult to rapidly grow user base
    due to existing competition
Technical Differences


• Facebook requires proprietary languages (FBML, FQL,
  FBJS). Google requires XML and JavaScript

• Google provides an IDE (aka Google Gadget Editor)

• Google hosts applications for free. Facebook doesn’t
Language Support
Facebook API                   OpenSocial API
•   FBML                       •   XHTML/XML
•   FQL                        •   JavaScript
•   FBJS                       •   Full Support for AJAX
•   Partial support for AJAX   •   Backend languages like
•   Backend languages like         PHP, Java, .NET on
    PHP, Java, .NET on             Canvas
    Canvas
FB and Open social

• The choice of your platform should depend on
  demographic
• OpenSocial is modeled after Facebook. So if you’ve built
  a Facebook application before, it is relatively easy to
  learn OpenSocial
• “Write Once, Run Anywhere” is not exactly true. An
  Orkut specific OpenSocial app. Might not necessairly run
  on Hi5
Resources
• Getting Started Guide:
http://wiki.developers.facebook.com/index.php/Trying_Out_Facebook_Conne
ct
• Facebook Connect Policies:
http://wiki.developers.facebook.com/index.php/Facebook_Connect_Policies
• Facebook Connect: Developers Central
http://developers.facebook.com/docs/
• Graph API
http://graph.facebook.com/
• Websites using Facebook Connect sorted by active monthly users
 http://www.allfacebook.com
•Opensocial
http://code.google.com/apis/opensocial/
Thank you


Nguyễn Mạnh Tiến
tien.nguyen@tamtay.vn
www.tamtay.vn

Weitere ähnliche Inhalte

Was ist angesagt?

Facebook API for Developers : Introducing the Facebook Platform
Facebook API for Developers : Introducing the Facebook PlatformFacebook API for Developers : Introducing the Facebook Platform
Facebook API for Developers : Introducing the Facebook Platform
Wildan Maulana
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
h_marvin
 
Introduction to facebook platform
Introduction to facebook platformIntroduction to facebook platform
Introduction to facebook platform
Venkatesh Narayanan
 
Peepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebookPeepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebook
sushilprajapati
 

Was ist angesagt? (16)

Facebook API for iOS
Facebook API for iOSFacebook API for iOS
Facebook API for iOS
 
Facebook API for Developers : Introducing the Facebook Platform
Facebook API for Developers : Introducing the Facebook PlatformFacebook API for Developers : Introducing the Facebook Platform
Facebook API for Developers : Introducing the Facebook Platform
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)
 
How to develop app for facebook fan page
How to develop app for facebook fan pageHow to develop app for facebook fan page
How to develop app for facebook fan page
 
페이스북 소셜 앱 개발 가이드 2011
페이스북 소셜 앱 개발 가이드 2011페이스북 소셜 앱 개발 가이드 2011
페이스북 소셜 앱 개발 가이드 2011
 
Developers Tools: An overview of Facebook Development
Developers Tools: An overview of Facebook Development Developers Tools: An overview of Facebook Development
Developers Tools: An overview of Facebook Development
 
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
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...
Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...
Automating Site Provisioning in SharePoint - Presented 7/27/13 at SharePoint ...
 
My Sites in SharePoint 2010
My Sites in SharePoint 2010My Sites in SharePoint 2010
My Sites in SharePoint 2010
 
Introduction to facebook platform
Introduction to facebook platformIntroduction to facebook platform
Introduction to facebook platform
 
Peepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebookPeepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebook
 
Joomunited social backlinks
Joomunited social backlinksJoomunited social backlinks
Joomunited social backlinks
 
"Leveraging SharePoint for Project Management" for SPTech Conference SFO
"Leveraging SharePoint for Project Management" for SPTech Conference SFO"Leveraging SharePoint for Project Management" for SPTech Conference SFO
"Leveraging SharePoint for Project Management" for SPTech Conference SFO
 
7 Ways To Leverage SharePoint for Project Management Success
7 Ways To Leverage SharePoint for Project Management Success7 Ways To Leverage SharePoint for Project Management Success
7 Ways To Leverage SharePoint for Project Management Success
 

Andere mochten auch

Mobilemonday.vn mobile interaction - mr ng cuu long goldsun focus media
Mobilemonday.vn   mobile interaction - mr ng cuu long goldsun focus mediaMobilemonday.vn   mobile interaction - mr ng cuu long goldsun focus media
Mobilemonday.vn mobile interaction - mr ng cuu long goldsun focus media
Quang Anh Le
 

Andere mochten auch (7)

Mobilemonday.vn mobile interaction - mr ng cuu long goldsun focus media
Mobilemonday.vn   mobile interaction - mr ng cuu long goldsun focus mediaMobilemonday.vn   mobile interaction - mr ng cuu long goldsun focus media
Mobilemonday.vn mobile interaction - mr ng cuu long goldsun focus media
 
Facebook API
Facebook APIFacebook API
Facebook API
 
Hướng dẫn cách tăng like facebook tự động
Hướng dẫn cách tăng like facebook tự độngHướng dẫn cách tăng like facebook tự động
Hướng dẫn cách tăng like facebook tự động
 
Cách sử dụng tên miền thật khi chạy website ở localhost
Cách sử dụng tên miền thật khi chạy website ở localhostCách sử dụng tên miền thật khi chạy website ở localhost
Cách sử dụng tên miền thật khi chạy website ở localhost
 
Lập trình và thiết kế website tương tác với facebook tập 1
Lập trình và thiết kế website tương tác với facebook tập 1Lập trình và thiết kế website tương tác với facebook tập 1
Lập trình và thiết kế website tương tác với facebook tập 1
 
Làm thế nào để tăng 10.000 like trong 7 ngày
Làm thế nào để tăng 10.000 like trong 7 ngàyLàm thế nào để tăng 10.000 like trong 7 ngày
Làm thế nào để tăng 10.000 like trong 7 ngày
 
Hướng dẫn quản trị Facebook Fanpage
Hướng dẫn quản trị Facebook FanpageHướng dẫn quản trị Facebook Fanpage
Hướng dẫn quản trị Facebook Fanpage
 

Ähnlich wie Php day 2011 - Interactive-with-facebook

Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NETVirtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Krishna T
 
Facebook API
Facebook APIFacebook API
Facebook API
snipermkd
 
Optimizing WordPress sites for SEO and social media by Miriam Schwab
Optimizing WordPress sites for SEO and social media by Miriam SchwabOptimizing WordPress sites for SEO and social media by Miriam Schwab
Optimizing WordPress sites for SEO and social media by Miriam Schwab
Miriam Schwab
 
DevCon 2010 - Facebook Apps development for ASP.NET devs
DevCon 2010 - Facebook Apps development  for ASP.NET devsDevCon 2010 - Facebook Apps development  for ASP.NET devs
DevCon 2010 - Facebook Apps development for ASP.NET devs
Krishna T
 
The Flash Facebook Cookbook - FlashMidlands
The Flash Facebook Cookbook - FlashMidlandsThe Flash Facebook Cookbook - FlashMidlands
The Flash Facebook Cookbook - FlashMidlands
James Ford
 

Ähnlich wie Php day 2011 - Interactive-with-facebook (20)

Build social apps for Facebook
Build social apps for FacebookBuild social apps for Facebook
Build social apps for Facebook
 
Facebook Open Stream API - Facebook Developer Garage Dhaka
Facebook Open Stream API - Facebook Developer Garage DhakaFacebook Open Stream API - Facebook Developer Garage Dhaka
Facebook Open Stream API - Facebook Developer Garage Dhaka
 
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NETVirtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
 
Facebook Developer Garage Toronto - Syncapse Presentation
Facebook Developer Garage Toronto - Syncapse PresentationFacebook Developer Garage Toronto - Syncapse Presentation
Facebook Developer Garage Toronto - Syncapse Presentation
 
Socializing your-site-with-facebook-connect-1233555047748651-1
Socializing your-site-with-facebook-connect-1233555047748651-1Socializing your-site-with-facebook-connect-1233555047748651-1
Socializing your-site-with-facebook-connect-1233555047748651-1
 
Facebook app development
Facebook app developmentFacebook app development
Facebook app development
 
Facebook API
Facebook APIFacebook API
Facebook API
 
Optimizing WordPress sites for SEO and social media by Miriam Schwab
Optimizing WordPress sites for SEO and social media by Miriam SchwabOptimizing WordPress sites for SEO and social media by Miriam Schwab
Optimizing WordPress sites for SEO and social media by Miriam Schwab
 
Facebook Application Crash Course
Facebook Application Crash CourseFacebook Application Crash Course
Facebook Application Crash Course
 
DevCon 2010 - Facebook Apps development for ASP.NET devs
DevCon 2010 - Facebook Apps development  for ASP.NET devsDevCon 2010 - Facebook Apps development  for ASP.NET devs
DevCon 2010 - Facebook Apps development for ASP.NET devs
 
What's New on the Facebook Platform, July 2011
What's New on the Facebook Platform, July 2011What's New on the Facebook Platform, July 2011
What's New on the Facebook Platform, July 2011
 
Kt 15 07-2013
Kt 15 07-2013Kt 15 07-2013
Kt 15 07-2013
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for Beginners
 
Iskandar Najmuddin
Iskandar NajmuddinIskandar Najmuddin
Iskandar Najmuddin
 
Vishu Gupta - Facebook Developer Garage Bangalore
Vishu Gupta - Facebook Developer Garage BangaloreVishu Gupta - Facebook Developer Garage Bangalore
Vishu Gupta - Facebook Developer Garage Bangalore
 
VU University Amsterdam - The Social Web 2016 - Lecture 2
VU University Amsterdam - The Social Web 2016 - Lecture 2VU University Amsterdam - The Social Web 2016 - Lecture 2
VU University Amsterdam - The Social Web 2016 - Lecture 2
 
"Facebook Platform Best Practices" - Facebook Developer Garage Bangalore
"Facebook Platform Best Practices" -  Facebook Developer Garage Bangalore"Facebook Platform Best Practices" -  Facebook Developer Garage Bangalore
"Facebook Platform Best Practices" - Facebook Developer Garage Bangalore
 
GSP East 2008: Open Social: Open For Business
GSP East 2008: Open Social: Open For BusinessGSP East 2008: Open Social: Open For Business
GSP East 2008: Open Social: Open For Business
 
The Flash Facebook Cookbook - FlashMidlands
The Flash Facebook Cookbook - FlashMidlandsThe Flash Facebook Cookbook - FlashMidlands
The Flash Facebook Cookbook - FlashMidlands
 
OpenID vs Facebook Connect vs FriendConnect
OpenID vs Facebook Connect vs FriendConnectOpenID vs Facebook Connect vs FriendConnect
OpenID vs Facebook Connect vs FriendConnect
 

Mehr von Quang Anh Le

Mobilemonday.vn adflex
Mobilemonday.vn   adflexMobilemonday.vn   adflex
Mobilemonday.vn adflex
Quang Anh Le
 
Mobilemonday.vn momo-monetize thinking_tu do tai chinh_v1.2
Mobilemonday.vn   momo-monetize thinking_tu do tai chinh_v1.2Mobilemonday.vn   momo-monetize thinking_tu do tai chinh_v1.2
Mobilemonday.vn momo-monetize thinking_tu do tai chinh_v1.2
Quang Anh Le
 
02 mobile monday hanoi april 2013 vinova
02 mobile monday hanoi april 2013   vinova02 mobile monday hanoi april 2013   vinova
02 mobile monday hanoi april 2013 vinova
Quang Anh Le
 
01 mobile monday hanoi april 2013 mobile game - afoli
01 mobile monday hanoi april 2013   mobile game - afoli01 mobile monday hanoi april 2013   mobile game - afoli
01 mobile monday hanoi april 2013 mobile game - afoli
Quang Anh Le
 
03 mobile monday hanoi april 2013 monetize thinking g mo m-work
03 mobile monday hanoi april 2013 monetize thinking g mo   m-work03 mobile monday hanoi april 2013 monetize thinking g mo   m-work
03 mobile monday hanoi april 2013 monetize thinking g mo m-work
Quang Anh Le
 
2. minh chau momo t4
2. minh chau momo t42. minh chau momo t4
2. minh chau momo t4
Quang Anh Le
 
0. mobilemonday.vn hcm 20130424
0. mobilemonday.vn hcm 201304240. mobilemonday.vn hcm 20130424
0. mobilemonday.vn hcm 20130424
Quang Anh Le
 
Vietnam mobile day 2012 phan mem cho phai dep - mana
Vietnam mobile day 2012   phan mem cho phai dep - manaVietnam mobile day 2012   phan mem cho phai dep - mana
Vietnam mobile day 2012 phan mem cho phai dep - mana
Quang Anh Le
 
Vietnam mobile day 2012 i os memory management - techmaster
Vietnam mobile day 2012   i os memory management - techmasterVietnam mobile day 2012   i os memory management - techmaster
Vietnam mobile day 2012 i os memory management - techmaster
Quang Anh Le
 
Vietnam mobile day 2012 monetizing mobile apps games - rubycell
Vietnam mobile day 2012   monetizing mobile apps games - rubycellVietnam mobile day 2012   monetizing mobile apps games - rubycell
Vietnam mobile day 2012 monetizing mobile apps games - rubycell
Quang Anh Le
 
Vietnam mobile day 2012 cuoc cach mang thoi ky hau mobile - misfit
Vietnam mobile day 2012   cuoc cach mang thoi ky hau mobile - misfitVietnam mobile day 2012   cuoc cach mang thoi ky hau mobile - misfit
Vietnam mobile day 2012 cuoc cach mang thoi ky hau mobile - misfit
Quang Anh Le
 
Vietnam mobile day 2012 multi platform development - game loft
Vietnam mobile day 2012   multi platform development - game loftVietnam mobile day 2012   multi platform development - game loft
Vietnam mobile day 2012 multi platform development - game loft
Quang Anh Le
 
Vietnam mobile day 2012 developer opportunity - nokia
Vietnam mobile day 2012   developer opportunity - nokiaVietnam mobile day 2012   developer opportunity - nokia
Vietnam mobile day 2012 developer opportunity - nokia
Quang Anh Le
 
Vietnam mobile day 2012 building a mobile linux firmware for your router - ...
Vietnam mobile day 2012   building a mobile linux firmware for your router - ...Vietnam mobile day 2012   building a mobile linux firmware for your router - ...
Vietnam mobile day 2012 building a mobile linux firmware for your router - ...
Quang Anh Le
 
Vietnam mobile day 2012 ban quyen mobile contents - vsm
Vietnam mobile day 2012   ban quyen mobile contents - vsmVietnam mobile day 2012   ban quyen mobile contents - vsm
Vietnam mobile day 2012 ban quyen mobile contents - vsm
Quang Anh Le
 
Vietnam mobile day 2012 platform mo va ung dung de phat trien mang xa hoi m...
Vietnam mobile day 2012   platform mo va ung dung de phat trien mang xa hoi m...Vietnam mobile day 2012   platform mo va ung dung de phat trien mang xa hoi m...
Vietnam mobile day 2012 platform mo va ung dung de phat trien mang xa hoi m...
Quang Anh Le
 
Vietnam mobile day 2012 co hoi mobile tai vietnam - cyber agent
Vietnam mobile day 2012   co hoi mobile tai vietnam - cyber agentVietnam mobile day 2012   co hoi mobile tai vietnam - cyber agent
Vietnam mobile day 2012 co hoi mobile tai vietnam - cyber agent
Quang Anh Le
 
Vietnam mobile day 2012 html5 game using impact js - aiti-aptech
Vietnam mobile day 2012   html5 game using impact js - aiti-aptechVietnam mobile day 2012   html5 game using impact js - aiti-aptech
Vietnam mobile day 2012 html5 game using impact js - aiti-aptech
Quang Anh Le
 
Vietnam mobile day 2012 tuong lai cho nha phat trien nds - share plus
Vietnam mobile day 2012   tuong lai cho nha phat trien nds - share plusVietnam mobile day 2012   tuong lai cho nha phat trien nds - share plus
Vietnam mobile day 2012 tuong lai cho nha phat trien nds - share plus
Quang Anh Le
 
Vietnam mobile day 2012 trends in mobile marketing - fifth i media
Vietnam mobile day 2012   trends in mobile marketing - fifth i mediaVietnam mobile day 2012   trends in mobile marketing - fifth i media
Vietnam mobile day 2012 trends in mobile marketing - fifth i media
Quang Anh Le
 

Mehr von Quang Anh Le (20)

Mobilemonday.vn adflex
Mobilemonday.vn   adflexMobilemonday.vn   adflex
Mobilemonday.vn adflex
 
Mobilemonday.vn momo-monetize thinking_tu do tai chinh_v1.2
Mobilemonday.vn   momo-monetize thinking_tu do tai chinh_v1.2Mobilemonday.vn   momo-monetize thinking_tu do tai chinh_v1.2
Mobilemonday.vn momo-monetize thinking_tu do tai chinh_v1.2
 
02 mobile monday hanoi april 2013 vinova
02 mobile monday hanoi april 2013   vinova02 mobile monday hanoi april 2013   vinova
02 mobile monday hanoi april 2013 vinova
 
01 mobile monday hanoi april 2013 mobile game - afoli
01 mobile monday hanoi april 2013   mobile game - afoli01 mobile monday hanoi april 2013   mobile game - afoli
01 mobile monday hanoi april 2013 mobile game - afoli
 
03 mobile monday hanoi april 2013 monetize thinking g mo m-work
03 mobile monday hanoi april 2013 monetize thinking g mo   m-work03 mobile monday hanoi april 2013 monetize thinking g mo   m-work
03 mobile monday hanoi april 2013 monetize thinking g mo m-work
 
2. minh chau momo t4
2. minh chau momo t42. minh chau momo t4
2. minh chau momo t4
 
0. mobilemonday.vn hcm 20130424
0. mobilemonday.vn hcm 201304240. mobilemonday.vn hcm 20130424
0. mobilemonday.vn hcm 20130424
 
Vietnam mobile day 2012 phan mem cho phai dep - mana
Vietnam mobile day 2012   phan mem cho phai dep - manaVietnam mobile day 2012   phan mem cho phai dep - mana
Vietnam mobile day 2012 phan mem cho phai dep - mana
 
Vietnam mobile day 2012 i os memory management - techmaster
Vietnam mobile day 2012   i os memory management - techmasterVietnam mobile day 2012   i os memory management - techmaster
Vietnam mobile day 2012 i os memory management - techmaster
 
Vietnam mobile day 2012 monetizing mobile apps games - rubycell
Vietnam mobile day 2012   monetizing mobile apps games - rubycellVietnam mobile day 2012   monetizing mobile apps games - rubycell
Vietnam mobile day 2012 monetizing mobile apps games - rubycell
 
Vietnam mobile day 2012 cuoc cach mang thoi ky hau mobile - misfit
Vietnam mobile day 2012   cuoc cach mang thoi ky hau mobile - misfitVietnam mobile day 2012   cuoc cach mang thoi ky hau mobile - misfit
Vietnam mobile day 2012 cuoc cach mang thoi ky hau mobile - misfit
 
Vietnam mobile day 2012 multi platform development - game loft
Vietnam mobile day 2012   multi platform development - game loftVietnam mobile day 2012   multi platform development - game loft
Vietnam mobile day 2012 multi platform development - game loft
 
Vietnam mobile day 2012 developer opportunity - nokia
Vietnam mobile day 2012   developer opportunity - nokiaVietnam mobile day 2012   developer opportunity - nokia
Vietnam mobile day 2012 developer opportunity - nokia
 
Vietnam mobile day 2012 building a mobile linux firmware for your router - ...
Vietnam mobile day 2012   building a mobile linux firmware for your router - ...Vietnam mobile day 2012   building a mobile linux firmware for your router - ...
Vietnam mobile day 2012 building a mobile linux firmware for your router - ...
 
Vietnam mobile day 2012 ban quyen mobile contents - vsm
Vietnam mobile day 2012   ban quyen mobile contents - vsmVietnam mobile day 2012   ban quyen mobile contents - vsm
Vietnam mobile day 2012 ban quyen mobile contents - vsm
 
Vietnam mobile day 2012 platform mo va ung dung de phat trien mang xa hoi m...
Vietnam mobile day 2012   platform mo va ung dung de phat trien mang xa hoi m...Vietnam mobile day 2012   platform mo va ung dung de phat trien mang xa hoi m...
Vietnam mobile day 2012 platform mo va ung dung de phat trien mang xa hoi m...
 
Vietnam mobile day 2012 co hoi mobile tai vietnam - cyber agent
Vietnam mobile day 2012   co hoi mobile tai vietnam - cyber agentVietnam mobile day 2012   co hoi mobile tai vietnam - cyber agent
Vietnam mobile day 2012 co hoi mobile tai vietnam - cyber agent
 
Vietnam mobile day 2012 html5 game using impact js - aiti-aptech
Vietnam mobile day 2012   html5 game using impact js - aiti-aptechVietnam mobile day 2012   html5 game using impact js - aiti-aptech
Vietnam mobile day 2012 html5 game using impact js - aiti-aptech
 
Vietnam mobile day 2012 tuong lai cho nha phat trien nds - share plus
Vietnam mobile day 2012   tuong lai cho nha phat trien nds - share plusVietnam mobile day 2012   tuong lai cho nha phat trien nds - share plus
Vietnam mobile day 2012 tuong lai cho nha phat trien nds - share plus
 
Vietnam mobile day 2012 trends in mobile marketing - fifth i media
Vietnam mobile day 2012   trends in mobile marketing - fifth i mediaVietnam mobile day 2012   trends in mobile marketing - fifth i media
Vietnam mobile day 2012 trends in mobile marketing - fifth i media
 

Kürzlich hochgeladen

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Php day 2011 - Interactive-with-facebook

  • 1. Tích hợp trao đổi dữ liệu với Facebook By: Nguyễn Mạnh Tiến Tầm tay
  • 2. Agenda • FB connection • FB graph API • How work? • Technical steps • FB and Open Social
  • 3. Facebook overview About 400 million monthly active users About 60 million Connect users About 83% people trust their friends over any other source. About 36 TB/day
  • 4. Facebook connection? ● The next evolution of Facebook Platform ● It enables the integration of the Facebook Platform into your own site, allowing your users to: – Seamlessly "connect" their Facebook account and information with your site – Connect and find their friends who also use your site – Share information and actions on your site with their friends on Facebook through their profile pages & newsfeeds
  • 5. Facebook to my site? • Identity: Seamlessly connect the user's Facebook account and information with your site. • Friends: Bring a user's Facebook friends into your site. You can even link friends that have existing accounts. • Discovery: Publish information back into their friends' News Feeds on Facebook. • Privacy: Bring dynamic privacy to your site. • Reliability: The full power and flexibility of Facebook Platform.
  • 6. Should Use Facebook Connect? • One-click Login: Allow users to log in with their Facebook identity and allow your site to access their Facebook profile information. • Increased engagement: Leverage users' personal interests to show more relevant information and surface personalized content from friends such as reviews or comments. • New forms of distribution: Users can share content and actions taken on your site with friends back on Facebook through feed, invites, and other social communication channels on Facebook.
  • 8. Facebook Graph API? – Facebook's core – Presents a simple, consistent view of the Facebook social graph – Every object in the social graph has a unique ID. You can access the properties of an object by requesting https://graph.facebook.com/ID – People and pages with usernames can be accessed using their username as an ID – All responses are JSON objects – Relationships – Reading, Searching, Publishing, Deleting, Analytics
  • 11. How does it work?
  • 15. First step • Yêu cầu chung: YOUR_APP_ID • đăng ký với FB để lấy mã ID tương tác với ứng dụng của FB (FaceBook API) • http://developers.facebook.com/setup/
  • 16. Next step : Authentication  Authenticate on your site (out of FB). Method of authentication : in code - server side : The server-side flow is used whenever you need to call the Graph API from your web server in html - client side : The client-side flow is used when you need to make calls to the Graph API from a client, such as JavaScript running in a Web browser or from a native mobile or desktop app  Iusse request : https://www.facebook.com/dialog/oauth? client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream  Return code to get access token key: Kết thúc Authentication thì FB sẽ trả về code để lấy token code và access vào graph protocol của FB để lấy các loại dữ liệu khác nguồn tham khảo : http://developers.facebook.com/docs/authentication
  • 17. Reading Using access token key, issuing HTTP GET requests , return data in json ví dụ truy cập feed : https://graph.facebook.com/id/feed?access_token=2227470867|2.AQA_W4- fDdlG-erj.3600.1306126800.0-1090002606|Ktp_XdsULJo0j-CAaUratCxJKqM Php code: <?php $readfeed_url = sprintf('https://graph.facebook.com/%d/feed?access_token=%s', $fbdata['fbid'], $fbdata['access_token'] ) ; $feed = json_decode(file_get_contents($readfeed_url)); ?>
  • 18. Publishing Using access token key: issuing HTTP POST requests Php code tương ứng : <?php $token = 3523452345..... $message = "Hello, Arjun. I like this new API"; $uid = arjun $url = https://graph.facebook.com/$uid/feed? access_token=$token&message=$message&method=post $result = file_get_contents($url); ?>
  • 20. Market Size and Competition • Ideally speaking, OpenSocial has a market potential for 250 million users as opposed to 64 million active users on Facebook • 15,000 Applications on Facebook. Difficult to rapidly grow user base due to a saturated market • Most existing Google Widgets can run on OpenSocial. Results? Difficult to rapidly grow user base due to existing competition
  • 21. Technical Differences • Facebook requires proprietary languages (FBML, FQL, FBJS). Google requires XML and JavaScript • Google provides an IDE (aka Google Gadget Editor) • Google hosts applications for free. Facebook doesn’t
  • 22. Language Support Facebook API OpenSocial API • FBML • XHTML/XML • FQL • JavaScript • FBJS • Full Support for AJAX • Partial support for AJAX • Backend languages like • Backend languages like PHP, Java, .NET on PHP, Java, .NET on Canvas Canvas
  • 23. FB and Open social • The choice of your platform should depend on demographic • OpenSocial is modeled after Facebook. So if you’ve built a Facebook application before, it is relatively easy to learn OpenSocial • “Write Once, Run Anywhere” is not exactly true. An Orkut specific OpenSocial app. Might not necessairly run on Hi5
  • 24. Resources • Getting Started Guide: http://wiki.developers.facebook.com/index.php/Trying_Out_Facebook_Conne ct • Facebook Connect Policies: http://wiki.developers.facebook.com/index.php/Facebook_Connect_Policies • Facebook Connect: Developers Central http://developers.facebook.com/docs/ • Graph API http://graph.facebook.com/ • Websites using Facebook Connect sorted by active monthly users http://www.allfacebook.com •Opensocial http://code.google.com/apis/opensocial/
  • 25. Thank you Nguyễn Mạnh Tiến tien.nguyen@tamtay.vn www.tamtay.vn