SlideShare a Scribd company logo
1 of 22
Developing Facebook Application
                     A basic introduction




         facebook
Who we are




Abhishek Deshpande            Chetan Gole
MBA Student                   MCA Student
Follow @Fitehal               Follow @_techie
Abhishek@whoisabhi.com        me@thechetan.com
What is Facebook
•More than 400 million active users on Facebook

•People spend over 500 billion minutes per month on Facebook

•over 160 million objects(pages, groups and events) that people interact

•More than 70 translations

•30% of Facebook users are from United States




                 Ref : http://www.facebook.com/press/info.php?statistics
Why Facebook App.

• Bring Existing App to FB World
• Campaigning on FB
• Building a Brand
Top Facebook Apps
Name                     Developer
1. FarmVille             Zynga
2. Static FBML           Facebook
3. Facebook for iPhone   Facebook
4. Birthday Cards        RockYou!
5. Texas HoldEm Poker    Zynga
6. Café World            Zynga
7. Causes                Causes
8. Mafia Wars            Zynga
9. PetVille              Zynga
10. Mobile               Facebook
What happens when you access
       Facebook App
What happens when
          you access Facebook
                  App




Image Credit : http://www.zilby.com/images/arch.png
Facebook Platform
• FBML / XFBML -Tag based markup language derived from
HTML / XML, with some extra Power to play with FB

• FQL - Facebook query language - Ideal for querying extra
data from Facebook Internal data tables.

•FBJS - Facebook version of Javascript minimizing threats of
Cross scripting attacks. Supports Most of DOM - Based
manipulation Methods
Facebook API
          Facebook API calls are grouped into various action
categories, each focuses on different aspect of platform.

Let us look at some basic ones :
facebook.auth - basic authentication checks for facebook users
facebook.feed - Post to facebook news feed
facebook.friends - query fb for various checks on a user's friends
facebook.notification - send messages to users
facebook.profile - set FBML in user's profile
facebook.events - way to access FB events
facebook.groups - access information for facebook groups
facebook.photos - interact with facebook photos
Client Libraries
PHP
      - Easy to use
      - Officially Supported
      - Wide options for Hosting



          Also Libraries are Available for Python, Ruby, .NET, Java & C++
FBML
• Facebook markup language derived from HTML /
XML.

• To distinguish between HTML and FBML in app code,
you need to prefix fb: to FBML tags

• More than 100 tags to play with.
<fb:name uid="1431430963" />       => you
<fb:name uid="1431430963" capitalize="true" /> => You
<fb:name uid="1431430963" possessive="true" /> => Your
<fb:name uid="1431430963" reflexive="true" /> => Yourself
<fb:name uid="1431430963" useyou="false" />     => Abhishek Deshpande
<fb:name uid="672981152" />             => Chetan Gole
<fb:name uid="672981152" firstnameonly="true" /> => Chetan
Add Bookmark


<fb:bookmark />
Shows Dialog
<fb:dialog id="simple-dialog">
<fb:dialog-title>simple Dialog</fb:dialog-title>
<fb:dialog-content> This is some garbage content to be displayed. </fb:dialog-
content>
<fb:dialog-button type="button" value="Okay!" close_dialog="1" />
</fb:dialog>
<a href="" clicktoshowdialog="simple-dialog">show Dialog</a>
FQL

• Same syntax as ANSI-SQL

• No implementation for Limit, Group
by, Order By Clauses
User Table
uid, first_name , middle_name, last_name, name , pic_small
, pic_big, pic_square, pic, affiliations, profile_update_time
,timezone ,religion ,birthday ,birthday_date ,sex
,hometown_location , meeting_sex , meeting_for ,
relationship_status , significant_other_id , political ,
current_location , activities, interests ,is_app_user , music ,
tv , movies , books , quotes ,about_me, hs_info ,
education_history , work_history ,notes_count , wall_count ,
status , has_added_app , online_presence , locale ,
proxied_email , profile_url , email_hashes ,
pic_small_with_logo , pic_big_with_logo ,
pic_square_with_logo , pic_with_logo , allowed_restrictions
, verified , profile_blurb , family , username , website ,
is_blocked , contact_email , email
$fql = "Select name, pic FROM user where
uid='100000860190302'";
$fql_result=$facebook->api_client->fql_query($fql);
print_r($fql_result);

Array (
       [name] => Pranay Patil
       [pic] =>
http://profile.ak.fbcdn.net/hprofile-ak-
sf2p/hs624.snc3/27399_100000860190302_8058_s.jpg
)
Functions (FQL)
• now()          Returns the current time.
• rand()         Generates a random number.
• strlen(string)        Returns the length of the string.
• concat(string, ...)   Concatenates the given strings (can take any
number of strings).
More Functions (FQL)
• substr(string, start, length) Gets a substring of the string.
• strpos(haystack, needle) Returns the position of needle in
haystack, or -1 if it is not found.
• lower(string) Converts the string to lower case.
• upper(string)           Converts the string to upper case.
• strip_tags(field) Strips HTML markup and encoding from a
specified FQL field.
FBJS
• <script> Tag is allowed
• Javascript/DOM "id" values are rewritten on-the-fly

<a href="#" onclick="new Dialog().showMessage('Dialog', 'Hello
World.'); return false;"> Display Dialog.</a>
Developer resources
• Test Console http://developers.facebook.com/tools.php

• Developer Application http://www.facebook.com/developers/

• Developer Wiki http://wiki.developers.facebook.com
if (questions)
{
       for Q in questions:
              answer(Q)
} else
{
       print "Thank you!"
}

More Related Content

Similar to Developing Facebook Application - Nagpur PHP Meetup

Facebook Development in 5 Minutes
Facebook Development in 5 MinutesFacebook Development in 5 Minutes
Facebook Development in 5 MinutesJesse Stay
 
Facebook plateform architecture presentation
Facebook plateform architecture   presentationFacebook plateform architecture   presentation
Facebook plateform architecture presentationInam Soomro
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for BeginnersJesse Stay
 
Introduction to facebook platform
Introduction to facebook platformIntroduction to facebook platform
Introduction to facebook platformVenkatesh Narayanan
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook AppsDavid Keener
 
The Face Behind Facebook
The Face Behind FacebookThe Face Behind Facebook
The Face Behind FacebookCory Bohon
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Colin Su
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integrationmujahidslideshare
 
Facebook Platform for Developers
Facebook Platform for DevelopersFacebook Platform for Developers
Facebook Platform for DevelopersLidan Hifi
 
Building an interactive timeline from facebook photos
Building an interactive timeline from facebook photosBuilding an interactive timeline from facebook photos
Building an interactive timeline from facebook photosRakesh Rajan
 
MozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMat Clayton
 
Peepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebookPeepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebooksushilprajapati
 
Interactive with-facebook
Interactive with-facebookInteractive with-facebook
Interactive with-facebookTien Nguyen
 
Php day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebookPhp day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebookQuang Anh Le
 
페이스북 소셜 앱 개발 가이드 2011
페이스북 소셜 앱 개발 가이드 2011페이스북 소셜 앱 개발 가이드 2011
페이스북 소셜 앱 개발 가이드 2011Sukjoon Kim
 
Google App Engine and Social Apps
Google App Engine and Social AppsGoogle App Engine and Social Apps
Google App Engine and Social AppsChris Schalk
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology StackHusain Ali
 

Similar to Developing Facebook Application - Nagpur PHP Meetup (20)

Facebook Development in 5 Minutes
Facebook Development in 5 MinutesFacebook Development in 5 Minutes
Facebook Development in 5 Minutes
 
Facebook plateform architecture presentation
Facebook plateform architecture   presentationFacebook plateform architecture   presentation
Facebook plateform architecture presentation
 
Creating a Facebook App
Creating a Facebook AppCreating a Facebook App
Creating a Facebook App
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 
Facebook Development for Beginners
Facebook Development for BeginnersFacebook Development for Beginners
Facebook Development for Beginners
 
Introduction to facebook platform
Introduction to facebook platformIntroduction to facebook platform
Introduction to facebook platform
 
Building Facebook Apps
Building Facebook AppsBuilding Facebook Apps
Building Facebook Apps
 
The Face Behind Facebook
The Face Behind FacebookThe Face Behind Facebook
The Face Behind Facebook
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)
 
Facebook Connect Integration
Facebook Connect IntegrationFacebook Connect Integration
Facebook Connect Integration
 
Facebook Platform for Developers
Facebook Platform for DevelopersFacebook Platform for Developers
Facebook Platform for Developers
 
Facebook Connect
Facebook ConnectFacebook Connect
Facebook Connect
 
Building an interactive timeline from facebook photos
Building an interactive timeline from facebook photosBuilding an interactive timeline from facebook photos
Building an interactive timeline from facebook photos
 
MozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social DesignMozCon Seattle 2011 - Social Design
MozCon Seattle 2011 - Social Design
 
Peepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebookPeepcode facebook-2-rails on facebook
Peepcode facebook-2-rails on facebook
 
Interactive with-facebook
Interactive with-facebookInteractive with-facebook
Interactive with-facebook
 
Php day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebookPhp day 2011 - Interactive-with-facebook
Php day 2011 - Interactive-with-facebook
 
페이스북 소셜 앱 개발 가이드 2011
페이스북 소셜 앱 개발 가이드 2011페이스북 소셜 앱 개발 가이드 2011
페이스북 소셜 앱 개발 가이드 2011
 
Google App Engine and Social Apps
Google App Engine and Social AppsGoogle App Engine and Social Apps
Google App Engine and Social Apps
 
Facebook Technology Stack
Facebook Technology StackFacebook Technology Stack
Facebook Technology Stack
 

Recently uploaded

(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ EscortsDelhi Escorts Service
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做j5bzwet6
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)oannq
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxShubham Rawat
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证kbdhl05e
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilabledollysharma2066
 

Recently uploaded (9)

(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
 
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptx
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
 

Developing Facebook Application - Nagpur PHP Meetup

  • 1. Developing Facebook Application A basic introduction facebook
  • 2. Who we are Abhishek Deshpande Chetan Gole MBA Student MCA Student Follow @Fitehal Follow @_techie Abhishek@whoisabhi.com me@thechetan.com
  • 3. What is Facebook •More than 400 million active users on Facebook •People spend over 500 billion minutes per month on Facebook •over 160 million objects(pages, groups and events) that people interact •More than 70 translations •30% of Facebook users are from United States Ref : http://www.facebook.com/press/info.php?statistics
  • 4. Why Facebook App. • Bring Existing App to FB World • Campaigning on FB • Building a Brand
  • 5. Top Facebook Apps Name Developer 1. FarmVille Zynga 2. Static FBML Facebook 3. Facebook for iPhone Facebook 4. Birthday Cards RockYou! 5. Texas HoldEm Poker Zynga 6. Café World Zynga 7. Causes Causes 8. Mafia Wars Zynga 9. PetVille Zynga 10. Mobile Facebook
  • 6. What happens when you access Facebook App
  • 7. What happens when you access Facebook App Image Credit : http://www.zilby.com/images/arch.png
  • 8. Facebook Platform • FBML / XFBML -Tag based markup language derived from HTML / XML, with some extra Power to play with FB • FQL - Facebook query language - Ideal for querying extra data from Facebook Internal data tables. •FBJS - Facebook version of Javascript minimizing threats of Cross scripting attacks. Supports Most of DOM - Based manipulation Methods
  • 9. Facebook API Facebook API calls are grouped into various action categories, each focuses on different aspect of platform. Let us look at some basic ones : facebook.auth - basic authentication checks for facebook users facebook.feed - Post to facebook news feed facebook.friends - query fb for various checks on a user's friends facebook.notification - send messages to users facebook.profile - set FBML in user's profile facebook.events - way to access FB events facebook.groups - access information for facebook groups facebook.photos - interact with facebook photos
  • 10. Client Libraries PHP - Easy to use - Officially Supported - Wide options for Hosting Also Libraries are Available for Python, Ruby, .NET, Java & C++
  • 11. FBML • Facebook markup language derived from HTML / XML. • To distinguish between HTML and FBML in app code, you need to prefix fb: to FBML tags • More than 100 tags to play with.
  • 12. <fb:name uid="1431430963" /> => you <fb:name uid="1431430963" capitalize="true" /> => You <fb:name uid="1431430963" possessive="true" /> => Your <fb:name uid="1431430963" reflexive="true" /> => Yourself <fb:name uid="1431430963" useyou="false" /> => Abhishek Deshpande <fb:name uid="672981152" /> => Chetan Gole <fb:name uid="672981152" firstnameonly="true" /> => Chetan
  • 14. Shows Dialog <fb:dialog id="simple-dialog"> <fb:dialog-title>simple Dialog</fb:dialog-title> <fb:dialog-content> This is some garbage content to be displayed. </fb:dialog- content> <fb:dialog-button type="button" value="Okay!" close_dialog="1" /> </fb:dialog> <a href="" clicktoshowdialog="simple-dialog">show Dialog</a>
  • 15. FQL • Same syntax as ANSI-SQL • No implementation for Limit, Group by, Order By Clauses
  • 16. User Table uid, first_name , middle_name, last_name, name , pic_small , pic_big, pic_square, pic, affiliations, profile_update_time ,timezone ,religion ,birthday ,birthday_date ,sex ,hometown_location , meeting_sex , meeting_for , relationship_status , significant_other_id , political , current_location , activities, interests ,is_app_user , music , tv , movies , books , quotes ,about_me, hs_info , education_history , work_history ,notes_count , wall_count , status , has_added_app , online_presence , locale , proxied_email , profile_url , email_hashes , pic_small_with_logo , pic_big_with_logo , pic_square_with_logo , pic_with_logo , allowed_restrictions , verified , profile_blurb , family , username , website , is_blocked , contact_email , email
  • 17. $fql = "Select name, pic FROM user where uid='100000860190302'"; $fql_result=$facebook->api_client->fql_query($fql); print_r($fql_result); Array ( [name] => Pranay Patil [pic] => http://profile.ak.fbcdn.net/hprofile-ak- sf2p/hs624.snc3/27399_100000860190302_8058_s.jpg )
  • 18. Functions (FQL) • now() Returns the current time. • rand() Generates a random number. • strlen(string) Returns the length of the string. • concat(string, ...) Concatenates the given strings (can take any number of strings).
  • 19. More Functions (FQL) • substr(string, start, length) Gets a substring of the string. • strpos(haystack, needle) Returns the position of needle in haystack, or -1 if it is not found. • lower(string) Converts the string to lower case. • upper(string) Converts the string to upper case. • strip_tags(field) Strips HTML markup and encoding from a specified FQL field.
  • 20. FBJS • <script> Tag is allowed • Javascript/DOM "id" values are rewritten on-the-fly <a href="#" onclick="new Dialog().showMessage('Dialog', 'Hello World.'); return false;"> Display Dialog.</a>
  • 21. Developer resources • Test Console http://developers.facebook.com/tools.php • Developer Application http://www.facebook.com/developers/ • Developer Wiki http://wiki.developers.facebook.com
  • 22. if (questions) { for Q in questions: answer(Q) } else { print "Thank you!" }