Matías Paterlini: Desarrollo de aplicaciones en Facebook

Post on 01-Sep-2014

2,185 views 3 download

Tags:

description

Charla de Matías Paterlini titulada "Desarrollo de aplicaciones en Facebook" en las Primeras Charlas del Grupo PHP Argentina

transcript

Facebook Apps Development

Introduction

by Matias Paterlini

Friday, March 12, 2010

me...• CTO / Co-Founder Altodot | Social Marketing

Technologies

• Former Social Media Specialist & Software Architect at Tweetboard

• Columnist at PulsoSocial.com

• Former Founder & CTO at:

• VirtualInmobiliario.com

• Cristones.com - Xristianos

Friday, March 12, 2010

Do you PHP?

Friday, March 12, 2010

Did you know?

• facebook holds +400 M people

• facebook built their own php compiler

• facebook created their own memcached extension

• facebook uses mysql sharded databases

• facebook built over PHP

Friday, March 12, 2010

Facebook Platform

how does it work?

Friday, March 12, 2010

The IFRAME wayFacebook

HTML + XFBML

Facebook Javascript API Facebook API PHP client

PHP

Friday, March 12, 2010

The FBML wayFacebook

FBML + HTML

Facebook FBJS wrapper Facebook API PHP client

PHP

Friday, March 12, 2010

Facebook Markup LanguageOn each Request:

• Facebook PHP makes a call to our servers asking for FBML + HTML

• Our PHP scripts generate FBML + HTML

• Facebook parses the FBML generated and:

• Throws errors (if exist)

• Replaces identities names in styles & FBJS code

• Generate HTML for the FBML controls added

Friday, March 12, 2010

XFBML

• They require the Facebook Javascript API library to get rendered

• Some controls are the same as FBML

• Some new controls like fb:fan

Friday, March 12, 2010

FBJS: Facebook Javascript

• It has the same syntax as Javascript.

• Different functions, style = setStyle, location = setLocation,

• New functions like: setTextValue, setInnerFBML

• Can’t use frameworks like Jquery, mootools, prototype

• It has it’s own effects functions to animate objects

Friday, March 12, 2010

FBJS Effects

• Move or resize elements at different speeds.

• Show or hide elements animated: Blur, Fades, etc.

FBJS Listeners• You can attach functions to dom events like clicks, overs,

etc.

• This is very useful when you add dynamic content retrieved by ajax, where you’re not allowed to use onclick, onmouseover, attributes.

Friday, March 12, 2010

Facebook Javascript API• It is a standard javascript library that connects to

Facebook REST servers to retrieve data.

• It analyzes the dome and replace xfbml tags for standard html

• It can be used on Iframe Applications or standalone sites

• It can coexist with frameworks like Jquery, mootools, prototype.

• It has a set of functions to retrieve data from users.

Friday, March 12, 2010

Facebook PHP API Client• A standard php library that connects to facebook RESTful

servers to get data from users.

• A set of methods to send and retrieve information.

• Can execute lots of methods on a batching transaction.

• Poorly documented

• Can execute FQL queries.

Friday, March 12, 2010

Facebook Query Language• A set of tables and a query language to consume that

data.

• You can only read those tables.

• You can only apply filters to indexed columns

• You can’t use Joins.

• You can’t use “NOT” operator

• You can use IN.

Friday, March 12, 2010

What do I choose?FBML or IFRAME app?• Iframes have session time Issues

• FBML requires to know the controls

• FBML is more strict, you can’t make any mistake of facebook will display an awful error on screen.

• On FBML, you’re limited to the functions that FBJS offers, while working on an Iframe you’re free to use any kind of Javascript Library

• FBML apps have latency issues, if your script takes more than 12 seconds to respond, the request is dropped

Friday, March 12, 2010

ORMs, MVC and Scalability Issues

ORMs such as propel and doctrine or MVC frameworks like Zend and Symfony can be used, but be careful, if the

ORM is not optimized you can can suffer scalability issues.

Do not bring all data (use lazy connections)

Friday, March 12, 2010

Altodot FFWFacebook FBML Writer• A standard php library that generates FBML tags.

• Precisely documented.

• Avoids loosing time reading Facebook Wiki.

• Speeds up development

Friday, March 12, 2010

Where do I learn?• Facebook Wiki: http://wiki.developers.facebook.com

• Altodot Blog: http://blog.altodot.com

What tools are there?• Facebook Tools:

• FBML Tester

• API methods Tester

Friday, March 12, 2010

Thanks!

matias@altodot.com

@paterlinimatias

blog.altodot.com

Questions?

Become a dotter: jobs@altodot.com

Friday, March 12, 2010