SlideShare a Scribd company logo
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

PPT
Yannick Gaultier - sh404SEF SEO and Analytics
ODP
Yannick Gaultier - Using sh404SEF to improve search engine ranking of your Jo...
ODP
SEO, Analytics and Security with sh404SEF (JoomlaDay South Africa, 2011, Cape...
PPT
Yahoo! BOSS and trainspotting
ODP
Ruby on discuz
PPT
SobiPro - More than a business directory extension
ODP
sh404SEF goes Social talk at JoomlaDay Midwest 2011
Yannick Gaultier - sh404SEF SEO and Analytics
Yannick Gaultier - Using sh404SEF to improve search engine ranking of your Jo...
SEO, Analytics and Security with sh404SEF (JoomlaDay South Africa, 2011, Cape...
Yahoo! BOSS and trainspotting
Ruby on discuz
SobiPro - More than a business directory extension
sh404SEF goes Social talk at JoomlaDay Midwest 2011

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

PPT
Facebook plateform architecture presentation
PDF
Facebook API for Developers : Introducing the Facebook Platform
PDF
funP 麻吉 開發者俱樂部十月份聚會
PPTX
Facebook Developer Garage Cyberjaya
KEY
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
PPTX
Alphageeks meetup - facebook api
PPTX
Introduction to facebook platform
PDF
Charlie Cheever Facebook Developer Garage Uganda
PPT
Creating a Facebook App
PPT
Facebook Coin
PPT
Facebook Platform - Tech
PDF
Matías Paterlini: Desarrollo de aplicaciones en Facebook
PDF
Build social apps for Facebook
PPT
Facebook Development in 5 Minutes
PDF
Building an interactive timeline from facebook photos
PDF
Developing Facebook Application
PDF
Facebook Connect Tutorial
PPTX
Facebook[The Nuts and Bolts Technology]
PPT
Happy facebook developer
KEY
Facebook Development for Beginners
Facebook plateform architecture presentation
Facebook API for Developers : Introducing the Facebook Platform
funP 麻吉 開發者俱樂部十月份聚會
Facebook Developer Garage Cyberjaya
23 FACEBOOK APP DEVELOPMENT ESSENTIALS
Alphageeks meetup - facebook api
Introduction to facebook platform
Charlie Cheever Facebook Developer Garage Uganda
Creating a Facebook App
Facebook Coin
Facebook Platform - Tech
Matías Paterlini: Desarrollo de aplicaciones en Facebook
Build social apps for Facebook
Facebook Development in 5 Minutes
Building an interactive timeline from facebook photos
Developing Facebook Application
Facebook Connect Tutorial
Facebook[The Nuts and Bolts Technology]
Happy facebook developer
Facebook Development for Beginners
Ad

Recently uploaded (20)

PPTX
THEORIES-PSYCH-3.pptx theory of Abraham Maslow
PDF
⚡ Prepping for grid failure_ 6 Must-Haves to Survive Blackout!.pdf
PPTX
Chapter-7-The-Spiritual-Self-.pptx-First
PPTX
UNIVERSAL HUMAN VALUES for NEP student .pptx
PPTX
Learn how to use Portable Grinders Safely
PPTX
How to Deal with Imposter Syndrome for Personality Development?
PDF
Quiet Wins: Why the Silent Fish Survives.pdf
PPTX
Understanding the Self power point presentation
PPTX
diasspresentationndkcnskndncelklkfndc.pptx
PPTX
Learn numerology content and join tarot reading
PDF
The Zeigarnik Effect by Meenakshi Khakat.pdf
PDF
Elle Lalli on The Role of Emotional Intelligence in Entrepreneurship
PPTX
Learn how to prevent Workplace Incidents?
PPT
proper hygiene for teenagers for secondary students .ppt
PDF
Red Light Wali Muskurahat – A Heart-touching Hindi Story
PPTX
Personal Development - By Knowing Oneself?
PPTX
Commmunication in Todays world- Principles and Barriers
PDF
SEX-GENDER-AND-SEXUALITY-LESSON-1-M (2).pdf
PDF
Top 10 Visionary Entrepreneurs to Watch in 2025
PPT
cypt-cht-healthy-relationships-part1-presentation-v1.1en.ppt
THEORIES-PSYCH-3.pptx theory of Abraham Maslow
⚡ Prepping for grid failure_ 6 Must-Haves to Survive Blackout!.pdf
Chapter-7-The-Spiritual-Self-.pptx-First
UNIVERSAL HUMAN VALUES for NEP student .pptx
Learn how to use Portable Grinders Safely
How to Deal with Imposter Syndrome for Personality Development?
Quiet Wins: Why the Silent Fish Survives.pdf
Understanding the Self power point presentation
diasspresentationndkcnskndncelklkfndc.pptx
Learn numerology content and join tarot reading
The Zeigarnik Effect by Meenakshi Khakat.pdf
Elle Lalli on The Role of Emotional Intelligence in Entrepreneurship
Learn how to prevent Workplace Incidents?
proper hygiene for teenagers for secondary students .ppt
Red Light Wali Muskurahat – A Heart-touching Hindi Story
Personal Development - By Knowing Oneself?
Commmunication in Todays world- Principles and Barriers
SEX-GENDER-AND-SEXUALITY-LESSON-1-M (2).pdf
Top 10 Visionary Entrepreneurs to Watch in 2025
cypt-cht-healthy-relationships-part1-presentation-v1.1en.ppt
Ad

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!" }