facebook platform 101 l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Facebook Platform: 101 PowerPoint Presentation
Download Presentation
Facebook Platform: 101

Loading in 2 Seconds...

play fullscreen
1 / 13

Facebook Platform: 101 - PowerPoint PPT Presentation


  • 376 Views
  • Uploaded on

Facebook Platform: 101 Network Journal Club Meeting Shaomei Wu shaomei@gmail.com May 7, 2008 You might want to know… How to create a Facebook App? How to get data using Facebook Platform? Guide to Create a Facebook App http://developers.facebook.com/step_by_step.php

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Facebook Platform: 101' - Sophia


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
facebook platform 101

Facebook Platform: 101

Network Journal Club Meeting

Shaomei Wu

shaomei@gmail.com

May 7, 2008

you might want to know
You might want to know…
  • How to create a Facebook App?
  • How to get data using Facebook Platform?
guide to create a facebook app http developers facebook com step by step php
Guide to Create a Facebook Apphttp://developers.facebook.com/step_by_step.php
  • Add the Developer Application
  • Get a web server and/with a database service (if you will use database) – Thanks Chris!
  • Create a new App in Developer
  • Configure your App:
    • The form is explained very clearly at: http://developers.facebook.com/step_by_step.php
a very quick start
A very quick start

← define Facebook Class

← given after you create a new App

step by step guide to creating facebook app http developers facebook com step by step php
Step-by-step Guide to Creating Facebook Apphttp://developers.facebook.com/step_by_step.php
extract data with your app http developers facebook com documentation php
Extract data with your Apphttp://developers.facebook.com/documentation.php
facebook apis http wiki developers facebook com index php api api methods
Facebook APIshttp://wiki.developers.facebook.com/index.php/API#API_Methods
  • A lot of handy functions provided with a Facebook Object.
  • For example: Users.getInfo
    • Returns a wide array of user-specific information for each user identifier passed, limited by the view of the current user.
examples of using apis
Examples of using APIs
  • Get current user’s first name and last name

$user_details=$this->facebook->api_client->users_getInfo($uid, array('last_name','first_name')); $data['first_name']=$user_details[0]['first_name']; $data['last_name']=$user_details[0]['last_name'];

facebook query http wiki developers facebook com index php fql
Facebook Queryhttp://wiki.developers.facebook.com/index.php/FQL
  • Facebook Query Language, or FQL
    • allows you to use a SQL-style interface to more easily query the same Facebook social data that you can access through other Facebook API methods (assuming your application has access!).
  • It can be very concise and powerful!
examples of using fql http wiki developers facebook com index php sample fql queries
Examples of using FQLhttp://wiki.developers.facebook.com/index.php/Sample_FQL_Queries
  • Get the names of the groups of which u1 is a member:

SELECT name FROM group WHERE gid IN (SELECT gid FROM group_member WHERE uid = ''u1'')

  • In PHP, you write:

$query = "YOUR QUERY HERE"; //(see above examples)

$array = $facebook->api_client->fql_query($query);

  • The returned array is multidimensional, so

$attribute = $array[0]['attribute'];

  • If there are no rows returned, check to see if there are any results like this:

if ($result != NULL)

fbml http wiki developers facebook com index php fqbml
FBMLhttp://wiki.developers.facebook.com/index.php/FQBML
  • Facebook Markup Language (FBML)
    • To me it looks like facebook CCS + a lot of predefined dynamics elements. “You can hook into several Facebook integration points, including the profile, profile actions, Facebook canvas, News Feed and Mini-Feed.“
    • Especially handy when you implement some Facebook styled things: wall posts,manipulate profile, invite friends, send out notifications…
examples of using fbml from the app i wrote
Examples of using FBML(from the App I wrote)
  • <?php
  • $invfbml = <<<FBML
  • You've been invited to take a Friendship Quiz.
  • <fb:name uid="$user" firstnameonly="true" shownetwork="false"/> wants you to take the quiz: {$test_name}.
  • <fb:req-choice url="http://apps.facebook.com/friendshiptest/$sNextUrl" label="Take a Friendship Quiz!" />
  • FBML;
  • ?>
  • <fb:request-form type="friendship test" action="post_invitation.php5" content="<?=htmlentities($invfbml)?>" method="POST" invite="true">
  • <fb:multi-friend-selector max="20" actiontext="Invite your friends to take a quiz!" showborder="true" rows="5" exclude_ids="<?=$arFriends?>">
  • <input type="hidden" name="test_id" value=<?php echo $tid;?>></input>
  • </fb:request-form>