SlideShare a Scribd company logo
Facebook and
 OpenSocial
Development


        Liran.zelkha@alunasoft.com
Aluna
 Israel’s leading Java/JavaEE and SOA
  consulting company
 Customers:
How Facebook Apps work
 Every profile page is made up of many
  independent portlets or profile boxes.
 Each portlet is generated statically by a possibly
  external application and stored by Facebook.
 It could be an iframe, but in most cases is not.
 Portlets are not actually changed in the profile
  page – they are changed elsewhere!
 Facebook has mechanisms to link in applications,
  and APIs for applications to communicate with
  Facebook.
Facebook Communication
         request for profile

            profile


         request for canvas
                                          request for canvas content

                                                Facebook API use

                                              update profile box, etc.

                                                   canvas
           canvas


user                           facebook.com                 application (UCT)
What can the API do
   Get a list of friend ids or friends who are
    running the same app
   Get and set notifications of events
   Set content of profile box
   Get specific information on a user
   Add to the Newsfeed for a user
   Etc.
Client Libraries
   Client libraries will simplify the calls to the
    platform by reducing the amount of code
    you have to write.

   If you don’t use a client library then will
    have to do the following for each method
    call:
    ◦ Construct a signature
    ◦ Create and send a HTTP POST request
    ◦ Parse the XML result of the request
Example Clients
   Facebook Clients
    ◦ PHP5
    ◦ Java
   Independent Clients
    ◦   ActionScript
    ◦   Cocoa
    ◦   PHP4
    ◦   Ruby
    ◦   Python
    ◦   VB.NET
Methods
   The facebook API currently has 20
    methods that can be used to get
    information from facebook accounts.
Authentication
   facebook.auth.createToken
    ◦ creates an auth_token to be passed in as a
      parameter to login.php
   facebook.auth.getSession
    ◦ returns the session key bound to an
      auth_token
Facebook Query Language
   Facebook.fql.query
    ◦ FQL is a way to query the same facebook data
      you can access through the other API
      functions, but with a SQL style interface.

    ◦ SELECT name, affiliations FROM user WHERE
      uid IN (SELECT uid2 FROM friend WHERE
      uid1=211031) AND "Facebook" IN
      affiliations.name AND uid < 10
Events
   facebook.events.get
    ◦ returns all visible events according to the filters
      specified

   facebook.events.getMembers
    ◦ returns membership list data associated with
      an event
Friends
   facebook.friends.areFriends
    ◦ returns whether or not each pair of specified
      users is friends with each other
   facebook.friends.get
    ◦ returns the identifiers of the current user’s
      Facebook friends
   facebook.friends.getAppUsers
    ◦ returns the identifiers of the current user’s
      Facebook friends who are currently signed in
Groups
   facebook.groups.get
    ◦ returns all visible groups according to the
      filters specified
   facebook.groups.getMembers
    ◦ returns membership list data associated with a
      group
Notifications
   facebook.notifications.get
    ◦ returns information on outstanding Facebook
      notifications for current session user.
    ◦ such as messages, friend requests, pokes,
      group invites and event invites
Photos
   facebook.photos.addTag
    ◦ adds a tag with the given information to a
      photo
   facebook.photos.createAlbum
    ◦ creates and returns a new album owned by the
      current session user
   facebook.photos.get
    ◦ returns all visible photos according to the filters
      specified
Photos
   facebook.photos.getAlbums
    ◦ returns metadata about all of the photo albums
      uploaded by the specified user
   facebook.photos.getTags
    ◦ returns the set of user tags on all photos
      specified
   facebook.photos.upload
    ◦ uploads a photo owned by the current session
      user and returns the new photo
Users
   facebook.users.getInfo
    ◦ returns the information in a users profile
   facebook.users.getLoggedInUser
    ◦ gets the user id associated with the current
      session
Responses
   Each of these methods can have a
    different response format depending on
    what you are programming in.
    ◦ JSON (JavaScript Object Notation)
    ◦ XML
    ◦ Facebook PHP Client
FBML
   Language used by Facebook to specify
    any fragment of Web pages.
   Mostly just like HTML!
   Forms get additional fields added to pass
    Facebook parameters silently.
   Images are redirected to local copies.
   Links must be absolute (parameters do
    not work as expected in all toolkits).
   Lots of additional Facebook-specific items
    ◦ <fb:name uid=…> for a user’s name
    ◦ <fb:profile-pic …> for a user’s profile picture
FQL
   Facebook Query Language allows access
    to user database with language that is
    similar to SQL.

   Example:
    ◦ SELECT first_name FROM user WHERE
      uid=$params->{user}
    ◦ To get the first name of a user based on the
      user-id
Creating an Application
   What you need:
    ◦ Web Server
    ◦ API toolkit or roll-your-own
 Add the Developer application to your
  profile.
 Switch to the Developer application.
 Apply for a key.
Alphageeks meetup - facebook api
Alphageeks meetup - facebook api
Alphageeks meetup - facebook api
Alphageeks meetup - facebook api
What does a typical application
                 do?
   Check CGI parameters.
   Authenticate using Facebook API.
   Draw configuration Web page on canvas.
   Allow user to update options …
   Write FBML to profile box.
   Save per-user state in database or in
    filesystem.
Example: Profile Box
Example: Application Canvas
Open Social
What problem does it try to solve?
   Writing applications specifically for a
    single API
Alphageeks meetup - facebook api
Why?


   Developers                 Site Owners
    ◦ Can reuse apps on         ◦ New site
      new social networks         immediately gains
    ◦ Reduce code                 many applications
      maintenance               ◦ Pre-existing broad
    ◦ Increased potential         developer base
      audience for
      application
Who Does It?
Alphageeks meetup - facebook api

More Related Content

What's hot (18)

PPTX
Introduction to facebook platform
Venkatesh Narayanan
 
PPTX
Joomunited social backlinks
xavierreiss
 
PPT
Facebook Apps
Cosmin Stefanache
 
PPT
Creating a Facebook App
Mindgrub Technologies
 
PDF
Interactive with-facebook
Tien Nguyen
 
PPT
Iskandar Najmuddin
iPlatform
 
PDF
Facebook APIs
Andrew Sorensen
 
PDF
Php day 2011 - Interactive-with-facebook
Quang Anh Le
 
PPT
Firefox OS Apps
Hemant Devarapalli
 
PPS
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Krishna T
 
PPTX
Creating a content managed facebook app
OS-Cubed, Inc.
 
PDF
[Code Camp] Ứng dụng Facebook API vào phát triển website
Sieu Web
 
PPTX
Facebook Apps
davebalogh
 
PPT
Facebook Platform - Tech
David Zhuang
 
PDF
Leveraging Rails to Build Facebook Apps
David Keener
 
PPT
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
Sabuj Kundu
 
PDF
Facebook Python SDK - Introduction
Colin Su
 
PPT
What's New on the Facebook Platform, August 2010
Nudge Social Media
 
Introduction to facebook platform
Venkatesh Narayanan
 
Joomunited social backlinks
xavierreiss
 
Facebook Apps
Cosmin Stefanache
 
Creating a Facebook App
Mindgrub Technologies
 
Interactive with-facebook
Tien Nguyen
 
Iskandar Najmuddin
iPlatform
 
Facebook APIs
Andrew Sorensen
 
Php day 2011 - Interactive-with-facebook
Quang Anh Le
 
Firefox OS Apps
Hemant Devarapalli
 
Virtual Tech Days 2010 - Integrating Social Networks with ASP.NET
Krishna T
 
Creating a content managed facebook app
OS-Cubed, Inc.
 
[Code Camp] Ứng dụng Facebook API vào phát triển website
Sieu Web
 
Facebook Apps
davebalogh
 
Facebook Platform - Tech
David Zhuang
 
Leveraging Rails to Build Facebook Apps
David Keener
 
Developing Joomla Extensions JUG Bangladesh meetup dhaka-2012
Sabuj Kundu
 
Facebook Python SDK - Introduction
Colin Su
 
What's New on the Facebook Platform, August 2010
Nudge Social Media
 

Viewers also liked (11)

PPT
Intro to Agile Practices and Values
OpenSource Connections
 
PPT
Release planning
Abhay Kumar
 
PPTX
Release Planning. For Agile Teams. A Quick Overview
Michael Benning
 
PPTX
Agile Release Planning
Michael J Geiser
 
PDF
Release planning in Scrum
Arne Åhlander
 
PDF
ScrumGuides Agile Estimating And Planning With Scrum
Alexey Krivitsky
 
PDF
How to motivate your team during Scrum?
Dimitri Honlet
 
PPTX
Agile Estimating and Planning Using Scrum
Tommy Norman
 
PPTX
Scrum@accenture
Pierre E. NEIS
 
PDF
Marketing the Agile Way - Applying Scrum Outside of Develoment
Kirsten Knipp
 
PPTX
Beginner's Guide to Agile Release Planning
Payton Consulting
 
Intro to Agile Practices and Values
OpenSource Connections
 
Release planning
Abhay Kumar
 
Release Planning. For Agile Teams. A Quick Overview
Michael Benning
 
Agile Release Planning
Michael J Geiser
 
Release planning in Scrum
Arne Åhlander
 
ScrumGuides Agile Estimating And Planning With Scrum
Alexey Krivitsky
 
How to motivate your team during Scrum?
Dimitri Honlet
 
Agile Estimating and Planning Using Scrum
Tommy Norman
 
Scrum@accenture
Pierre E. NEIS
 
Marketing the Agile Way - Applying Scrum Outside of Develoment
Kirsten Knipp
 
Beginner's Guide to Agile Release Planning
Payton Consulting
 
Ad

Similar to Alphageeks meetup - facebook api (20)

PPT
Facebook 3rd Party Api
Yoss Cohen
 
PPT
Facebook Coin
Sathiyamoorthi
 
PPT
Facebook plateform architecture presentation
Inam Soomro
 
PPT
Facebook API
snipermkd
 
PDF
Peepcode facebook-2-rails on facebook
sushilprajapati
 
PDF
Building an interactive timeline from facebook photos
Rakesh Rajan
 
PDF
Facebook Connect Tutorial
Prateek Dayal
 
PPT
Facebook_Coin
Sathiyamoorthi
 
PPT
Facebook Coin
Sathiyamoorthi
 
PPT
Facebook Coin
Sathiyamoorthi
 
PPT
Connect with Facebook to Rails Application By Nyros Developer
Nyros Technologies
 
PDF
Developing Facebook Application
Kanda Runapongsa Saikaew
 
PDF
Google App Engine and Social Apps
Chris Schalk
 
PDF
Introduction to Facebook Javascript SDK (NEW)
Colin Su
 
ODP
Case Study FourSquare and Facebook Search Mobile Application
Mike Taylor
 
PDF
Workshop : Facebook JavaScript SDK
Dimitar Danailov
 
PPT
Ikandar Najmuddin - "What's new?"
iPlatform
 
PPT
Whats New On The Facebook Platform Feb 2010 Iskandar
Nudge Social Media
 
PDF
Facebook Platform for Developers
Lidan Hifi
 
PDF
Introduction to facebook java script sdk
Yi-Fan Chu
 
Facebook 3rd Party Api
Yoss Cohen
 
Facebook Coin
Sathiyamoorthi
 
Facebook plateform architecture presentation
Inam Soomro
 
Facebook API
snipermkd
 
Peepcode facebook-2-rails on facebook
sushilprajapati
 
Building an interactive timeline from facebook photos
Rakesh Rajan
 
Facebook Connect Tutorial
Prateek Dayal
 
Facebook_Coin
Sathiyamoorthi
 
Facebook Coin
Sathiyamoorthi
 
Facebook Coin
Sathiyamoorthi
 
Connect with Facebook to Rails Application By Nyros Developer
Nyros Technologies
 
Developing Facebook Application
Kanda Runapongsa Saikaew
 
Google App Engine and Social Apps
Chris Schalk
 
Introduction to Facebook Javascript SDK (NEW)
Colin Su
 
Case Study FourSquare and Facebook Search Mobile Application
Mike Taylor
 
Workshop : Facebook JavaScript SDK
Dimitar Danailov
 
Ikandar Najmuddin - "What's new?"
iPlatform
 
Whats New On The Facebook Platform Feb 2010 Iskandar
Nudge Social Media
 
Facebook Platform for Developers
Lidan Hifi
 
Introduction to facebook java script sdk
Yi-Fan Chu
 
Ad

More from Alphageeks (7)

PPTX
Shayke's SCRUM @alphageeks 6
Alphageeks
 
PDF
The secrets of developer happiness - Yuval Goldstein @ alphageeks 5
Alphageeks
 
PDF
Do You Write Secure Code? by Erez Metula
Alphageeks
 
PDF
Alphageeks #4: Example Embedding By Ohad Barzilay
Alphageeks
 
PPTX
Refael Ackermann @alphageeks on HTML5
Alphageeks
 
PPS
Afik Gal @alphageeks: Flex Intro
Alphageeks
 
PDF
Alphageeks meetup - Semantic Applications For Web
Alphageeks
 
Shayke's SCRUM @alphageeks 6
Alphageeks
 
The secrets of developer happiness - Yuval Goldstein @ alphageeks 5
Alphageeks
 
Do You Write Secure Code? by Erez Metula
Alphageeks
 
Alphageeks #4: Example Embedding By Ohad Barzilay
Alphageeks
 
Refael Ackermann @alphageeks on HTML5
Alphageeks
 
Afik Gal @alphageeks: Flex Intro
Alphageeks
 
Alphageeks meetup - Semantic Applications For Web
Alphageeks
 

Recently uploaded (20)

PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 

Alphageeks meetup - facebook api

  • 2. Aluna  Israel’s leading Java/JavaEE and SOA consulting company  Customers:
  • 3. How Facebook Apps work  Every profile page is made up of many independent portlets or profile boxes.  Each portlet is generated statically by a possibly external application and stored by Facebook.  It could be an iframe, but in most cases is not.  Portlets are not actually changed in the profile page – they are changed elsewhere!  Facebook has mechanisms to link in applications, and APIs for applications to communicate with Facebook.
  • 4. Facebook Communication request for profile profile request for canvas request for canvas content Facebook API use update profile box, etc. canvas canvas user facebook.com application (UCT)
  • 5. What can the API do  Get a list of friend ids or friends who are running the same app  Get and set notifications of events  Set content of profile box  Get specific information on a user  Add to the Newsfeed for a user  Etc.
  • 6. Client Libraries  Client libraries will simplify the calls to the platform by reducing the amount of code you have to write.  If you don’t use a client library then will have to do the following for each method call: ◦ Construct a signature ◦ Create and send a HTTP POST request ◦ Parse the XML result of the request
  • 7. Example Clients  Facebook Clients ◦ PHP5 ◦ Java  Independent Clients ◦ ActionScript ◦ Cocoa ◦ PHP4 ◦ Ruby ◦ Python ◦ VB.NET
  • 8. Methods  The facebook API currently has 20 methods that can be used to get information from facebook accounts.
  • 9. Authentication  facebook.auth.createToken ◦ creates an auth_token to be passed in as a parameter to login.php  facebook.auth.getSession ◦ returns the session key bound to an auth_token
  • 10. Facebook Query Language  Facebook.fql.query ◦ FQL is a way to query the same facebook data you can access through the other API functions, but with a SQL style interface. ◦ SELECT name, affiliations FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=211031) AND "Facebook" IN affiliations.name AND uid < 10
  • 11. Events  facebook.events.get ◦ returns all visible events according to the filters specified  facebook.events.getMembers ◦ returns membership list data associated with an event
  • 12. Friends  facebook.friends.areFriends ◦ returns whether or not each pair of specified users is friends with each other  facebook.friends.get ◦ returns the identifiers of the current user’s Facebook friends  facebook.friends.getAppUsers ◦ returns the identifiers of the current user’s Facebook friends who are currently signed in
  • 13. Groups  facebook.groups.get ◦ returns all visible groups according to the filters specified  facebook.groups.getMembers ◦ returns membership list data associated with a group
  • 14. Notifications  facebook.notifications.get ◦ returns information on outstanding Facebook notifications for current session user. ◦ such as messages, friend requests, pokes, group invites and event invites
  • 15. Photos  facebook.photos.addTag ◦ adds a tag with the given information to a photo  facebook.photos.createAlbum ◦ creates and returns a new album owned by the current session user  facebook.photos.get ◦ returns all visible photos according to the filters specified
  • 16. Photos  facebook.photos.getAlbums ◦ returns metadata about all of the photo albums uploaded by the specified user  facebook.photos.getTags ◦ returns the set of user tags on all photos specified  facebook.photos.upload ◦ uploads a photo owned by the current session user and returns the new photo
  • 17. Users  facebook.users.getInfo ◦ returns the information in a users profile  facebook.users.getLoggedInUser ◦ gets the user id associated with the current session
  • 18. Responses  Each of these methods can have a different response format depending on what you are programming in. ◦ JSON (JavaScript Object Notation) ◦ XML ◦ Facebook PHP Client
  • 19. FBML  Language used by Facebook to specify any fragment of Web pages.  Mostly just like HTML!  Forms get additional fields added to pass Facebook parameters silently.  Images are redirected to local copies.  Links must be absolute (parameters do not work as expected in all toolkits).  Lots of additional Facebook-specific items ◦ <fb:name uid=…> for a user’s name ◦ <fb:profile-pic …> for a user’s profile picture
  • 20. FQL  Facebook Query Language allows access to user database with language that is similar to SQL.  Example: ◦ SELECT first_name FROM user WHERE uid=$params->{user} ◦ To get the first name of a user based on the user-id
  • 21. Creating an Application  What you need: ◦ Web Server ◦ API toolkit or roll-your-own  Add the Developer application to your profile.  Switch to the Developer application.  Apply for a key.
  • 26. What does a typical application do?  Check CGI parameters.  Authenticate using Facebook API.  Draw configuration Web page on canvas.  Allow user to update options …  Write FBML to profile box.  Save per-user state in database or in filesystem.
  • 30. What problem does it try to solve?  Writing applications specifically for a single API
  • 32. Why?  Developers  Site Owners ◦ Can reuse apps on ◦ New site new social networks immediately gains ◦ Reduce code many applications maintenance ◦ Pre-existing broad ◦ Increased potential developer base audience for application