SlideShare une entreprise Scribd logo
1  sur  36
Facebook Development using Zend Framework Brett Harris
Make it work. Make it right. Make it fast. Make it fast. Make it fast.
Challenges ,[object Object],[object Object],[object Object]
Development Environment  & Deployment & Deployment ,[object Object],[object Object],[object Object]
3-Tier Architecture
5-Tier Architecture
Development Environment ,[object Object],[object Object],[object Object]
Proxy Pattern http://en.wikipedia.org/wiki/Proxy_pattern
Dev Environment Proxy
FBML Parser <html> ... <h1> <fb:profile-pic uid=&quot;12345&quot; size=&quot;thumb&quot; /> <fb:name uid=&quot;12345&quot; /> </h1> <hr/> <p> <fb:user-status uid=&quot;12345&quot; linked=&quot;false&quot;/> </p> ... </html>
FBML Parser Parsed by Facebook Not parsed Brett Harris is presenting at ZendCon
FBML Parser Proxy function  smarty_function_fb_name( $params , & $smarty ) { if  (Framework_Config::get( 'MODE')  ==  'local' ) { return   'Grant Raphael' ; } $fbml =  '<fb:name ' ; foreach  ( $params   as   $key  =>  $value ) { $fbml .=  $key  .  '=&quot;'  . addslashes( $value ) .  '&quot;' ; } $fbml .=  ' />' ; return   $fbml ; } http://smarty.net/manual/en/plugins.php
FBML Parsing Mock <html> ... <h1> {fb_profile_pic uid=&quot;12345&quot; size=&quot;thumb&quot; } {fb_name uid=&quot;12345&quot; } </h1> <hr/> <p> {fb_user_status uid=&quot;12345&quot; linked=&quot;false&quot; } </p> ... </html>
FBML Parsing Mock Grant Raphael is updating their status Parsed by Facebook Not parsed Brett Harris is speaking at ZendCon
Configuration ,[object Object],[object Object],[environments] dev_foo_com  = DEV www_foo_com  = LIVE [DEV] APP_NAME  = sample_application BASE_DIR  = /var/www/html/sample ETC_DIR  = /var/www/html/sample/FBFramework/application/etc MODEL_DIR  = /var/www/html/sample/FBFramework/application/model CONTROLLER_DIR  = /var/www/html/sample/FBFramework/application/controller VIEW_DIR  = /var/www/html/sample/FBFramework/application/public/view COMPILE_DIR  = /tmp/templates_c SESSION_DIR  = /tmp/sessions FRAMEWORK_DIR  = /var/www/html/sample/FBFramework/Framework UI_DIR  = /var/www/html/sample/FBFramework/Framework/UI DEFAULT_CONTROLLER  = index DEFAULT_ACTION  = index VIEW_EXTENSION  = tpl BASE_URL  =  http://dev.foo.com/sample EXTERNAL_URL  =  http://dev.foo.com/sample MODE  = local [facebook] FB_USER_ID  = 1 FB_FRIENDS  = 1,2,3,4,5 API_KEY  = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SECRET_KEY  = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SESSION_KEY  = XXXXXXXXXXXXXXXXXXXXXXXX-XXXXXXXXX
Differences from “Normal” Web ,[object Object],[object Object]
POST ,[object Object],[object Object]
POST ,[object Object],< html > ... <!--  http://dev.foo.com/sample/item/save  --> < form  method = &quot;post&quot;  action = &quot;{$EXTERNAL_URL}/item/save&quot; >  ... </ form > ... </ html > ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[environments] dev_foo_com  = DEV [DEV] ... BASE_URL  =  http://apps.facebook.com/sample EXTERNAL_URL  =  http://dev.foo.com/sample
Header Redirects ,[object Object]
Header Redirects ,[object Object],<?php class  ItemController  extends  Zend_Controller_Action { public   function  listAction() { try { $category_id = (int) $this ->_request->getParam( 'category_id' ); $this ->view->items = Item::find( 'category_id = ?' ,  $category_id ); } catch  (Exception  $e ) { // Forward to ErrorController::indexAction // aka http://www.foo.com/error/index $this ->_forward( 'index', 'error' );  } } } ?>
Learning Curve ,[object Object],[object Object],[object Object]
FQL ,[object Object],[object Object],[object Object]
ActiveRecord http://en.wikipedia.org/wiki/Active_record_pattern
Easier to learn <?php ... // Get the user object from FQL table $fb_user      =  new  Facebook_User( 12345 ); // Get the user's items from local SQL table $items  = Items::find( 'fb_user_id = ?' ,  $fb_user ->uid); ... ?> <?php ... // Get the user object from FQL table $fb_lib =  new  Facebook(API_KEY, SECRET_KEY); $fb_client =  $fb_lib ->api_client; $results =  $fb_client ->fql_query( 'SELECT uid, first_name, last_name, ... FROM user WHERE uid = &quot;12345&quot;' ); $fb_user_array = array_pop( $results ); // Get the user's items from local SQL table $items = Items::find( 'fb_user_id = ?' ,  $fb_user [ 'uid' ]); ... ?>
Don’t build CRUD ,[object Object],<?php ... // Get the user object from FQL table $fb_user =  new  Facebook_User( 12345 ); // Get an item from local SQL table $item =  new  Item( 1 ); // Bind item to the user's items in local SQL table $item_bind =  new  Item_Bind(); $item_bind ->fb_uid =  $fb_user ->uid; $item_bind ->item_id =  $item ->id; $item_bind ->save(); ... ?>
FBML ,[object Object],[object Object],[object Object],http://wiki.developers.facebook.com/index.php/FBML
FBML Proxy <html> ... <h1> {fb_profile_pic uid=&quot;12345&quot; size=&quot;thumb&quot; } {fb_name uid=&quot;12345&quot; } </h1> <hr/> <p> {fb_user_status uid=&quot;12345&quot; linked=&quot;false&quot; } </p> ... </html>
[object Object],[object Object],[object Object],Why stop with FBML?
UI Components < html > ... {Grid recordset=$recordset} {Column header=&quot;ID&quot; field=&quot;id&quot;} {Column header=&quot;Name&quot; field=&quot;name&quot;} {ColumnComplex header=&quot;Email&quot;} < a  href = &quot;mailto:{$record.email}&quot; > {$record.email} </ a > {/ColumnComplex} {/Grid} ... </ html > Make a grid - 3 columns (ID, Name, Email) - Loop through items in $recordset for rows < html > ... < table > < tr > < th > ID </ th > < th > Name </ th > < th > Email </ th > </ tr > <?php   foreach  ( $recordset   as   $record ) {  ?> < tr > < td > <? =  $record ->id  ?> </ td > < td > <? =  $record ->name  ?> </ td > < td > < a  href =&quot; mailto: <? =  $record ->email  ?> &quot; > <? =  $record ->email  ?> </ a > </ td > </ tr > <?php  }  ?> </ table > ... </ html > ID Name Email 1 John Doe [email_address] 2 Steve Smith [email_address]
Wrapping AJAX Libraries < html > ... < input  id = &quot;mb1&quot;  type = &quot;button&quot;  value = &quot;Show Popup&quot;  /> < script > Ext.onReady( function () { Ext.get( 'mb1' ).on( 'click' ,  function (e) { Ext.MessageBox.confirm( 'Confirm' ,  'Are you sure you want to do that?' , showResult); } ); </ script > ... </ html > < html > ... {PopupButton value=&quot;Show Popup&quot; header=&quot;Confirm&quot; message=&quot;Are you sure you want to do that?&quot; callback=&quot;showResult&quot;} ... </ html > http://extjs.com /
Multi-application interfaces http://zynga.com /
Make it work. Make it right. Make it fast. Make it fast. Make it fast.
Make a framework. Make it right. Make it fast. Make it fast. Make it fast.
Make a framework. Make it right. Use a framework. Use a framework. Use a framework.
Make a framework. Make great FB apps. Use a framework. Use a framework. Use a framework.
Shameless Plug ,[object Object]

Contenu connexe

Tendances

CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your MindCICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mindciconf
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginnersjeroenvdmeer
 
Facebook Social Plugins
Facebook Social PluginsFacebook Social Plugins
Facebook Social PluginsAizat Faiz
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsJohn Brunswick
 
Make Your Own Damn SEO Tools (Using Google Docs!)
Make Your Own Damn SEO Tools (Using Google Docs!)Make Your Own Damn SEO Tools (Using Google Docs!)
Make Your Own Damn SEO Tools (Using Google Docs!)Sean Malseed
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?brynary
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010Brendan Sera-Shriar
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingViget Labs
 
[PyConZA 2017] Web Scraping: Unleash your Internet Viking
[PyConZA 2017] Web Scraping: Unleash your Internet Viking[PyConZA 2017] Web Scraping: Unleash your Internet Viking
[PyConZA 2017] Web Scraping: Unleash your Internet VikingAndrew Collier
 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML FormsMike Crabb
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching ResurrectedBen Scofield
 

Tendances (16)

Jabber Bot
Jabber BotJabber Bot
Jabber Bot
 
CICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your MindCICONF 2012 - Don't Make Me Read Your Mind
CICONF 2012 - Don't Make Me Read Your Mind
 
PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
Facebook Social Plugins
Facebook Social PluginsFacebook Social Plugins
Facebook Social Plugins
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
PHP
PHPPHP
PHP
 
Make Your Own Damn SEO Tools (Using Google Docs!)
Make Your Own Damn SEO Tools (Using Google Docs!)Make Your Own Damn SEO Tools (Using Google Docs!)
Make Your Own Damn SEO Tools (Using Google Docs!)
 
Zend Form Tutorial
Zend Form TutorialZend Form Tutorial
Zend Form Tutorial
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
WordPress Development Confoo 2010
WordPress Development Confoo 2010WordPress Development Confoo 2010
WordPress Development Confoo 2010
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance Testing
 
[PyConZA 2017] Web Scraping: Unleash your Internet Viking
[PyConZA 2017] Web Scraping: Unleash your Internet Viking[PyConZA 2017] Web Scraping: Unleash your Internet Viking
[PyConZA 2017] Web Scraping: Unleash your Internet Viking
 
Getting Information through HTML Forms
Getting Information through HTML FormsGetting Information through HTML Forms
Getting Information through HTML Forms
 
Selenium for-ops
Selenium for-opsSelenium for-ops
Selenium for-ops
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 

En vedette

Facebook Presto presentation
Facebook Presto presentationFacebook Presto presentation
Facebook Presto presentationCyanny LIANG
 
Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developerYu-Wei Chuang
 
Making Facebook Faster
Making Facebook FasterMaking Facebook Faster
Making Facebook Fasterguest1240e7c
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App DevelopmentCristiano Betta
 
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
 
Creating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandCreating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandMatthew Turland
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKDimitar Danailov
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKColin Su
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk Yi-Fan Chu
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Yi-Fan Chu
 
Facebook Competitive Advantage (social networking)
Facebook Competitive Advantage (social networking)Facebook Competitive Advantage (social networking)
Facebook Competitive Advantage (social networking)Akash Senapaty
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenHARMAN Services
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M usersJongyoon Choi
 

En vedette (14)

Facebook Presto presentation
Facebook Presto presentationFacebook Presto presentation
Facebook Presto presentation
 
Happy facebook developer
Happy facebook developerHappy facebook developer
Happy facebook developer
 
Making Facebook Faster
Making Facebook FasterMaking Facebook Faster
Making Facebook Faster
 
Facebook App Development
Facebook App DevelopmentFacebook App Development
Facebook App Development
 
Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)Introduction to Facebook Javascript SDK (NEW)
Introduction to Facebook Javascript SDK (NEW)
 
Creating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew TurlandCreating Web Services with Zend Framework - Matthew Turland
Creating Web Services with Zend Framework - Matthew Turland
 
Workshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDKWorkshop : Facebook JavaScript SDK
Workshop : Facebook JavaScript SDK
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK
 
Introduction to facebook java script sdk
Introduction to facebook java script sdk Introduction to facebook java script sdk
Introduction to facebook java script sdk
 
Introduction to facebook javascript sdk
Introduction to facebook javascript sdk Introduction to facebook javascript sdk
Introduction to facebook javascript sdk
 
Facebook + Ruby
Facebook + RubyFacebook + Ruby
Facebook + Ruby
 
Facebook Competitive Advantage (social networking)
Facebook Competitive Advantage (social networking)Facebook Competitive Advantage (social networking)
Facebook Competitive Advantage (social networking)
 
Facebook Architecture - Breaking it Open
Facebook Architecture - Breaking it OpenFacebook Architecture - Breaking it Open
Facebook Architecture - Breaking it Open
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M users
 

Similaire à Facebook Development with Zend Framework

Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Michiel Rook
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в MagentoMagecom Ukraine
 
Flash templates for Joomla!
Flash templates for Joomla!Flash templates for Joomla!
Flash templates for Joomla!Herman Peeren
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Alfresco Software
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page CreationWildan Maulana
 
Alfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Software
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rob
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To LampAmzad Hossain
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop APIChris Jean
 
August 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterAugust 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterStraight North
 
FVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsFVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsPete DuMelle
 
Spyware/Malware FVCP
Spyware/Malware  FVCPSpyware/Malware  FVCP
Spyware/Malware FVCPPete DuMelle
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructurePamela Fox
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructureguest517f2f
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...Kirill Chebunin
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 

Similaire à Facebook Development with Zend Framework (20)

Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)Phing - A PHP Build Tool (An Introduction)
Phing - A PHP Build Tool (An Introduction)
 
Система рендеринга в Magento
Система рендеринга в MagentoСистема рендеринга в Magento
Система рендеринга в Magento
 
Flash templates for Joomla!
Flash templates for Joomla!Flash templates for Joomla!
Flash templates for Joomla!
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Alfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Forms Service Deep Dive
Alfresco Forms Service Deep Dive
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop API
 
August 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle TwitterAugust 10th, 2009 Pete De Mulle Twitter
August 10th, 2009 Pete De Mulle Twitter
 
FVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / WidgetsFVCP - Facebook , Twitter and Meetup API / Widgets
FVCP - Facebook , Twitter and Meetup API / Widgets
 
Spyware/Malware FVCP
Spyware/Malware  FVCPSpyware/Malware  FVCP
Spyware/Malware FVCP
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 
Alfresco Search Internals
Alfresco Search InternalsAlfresco Search Internals
Alfresco Search Internals
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Struts2
Struts2Struts2
Struts2
 
Html5
Html5Html5
Html5
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 

Dernier

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Dernier (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Facebook Development with Zend Framework

  • 1. Facebook Development using Zend Framework Brett Harris
  • 2. Make it work. Make it right. Make it fast. Make it fast. Make it fast.
  • 3.
  • 4.
  • 7.
  • 10. FBML Parser <html> ... <h1> <fb:profile-pic uid=&quot;12345&quot; size=&quot;thumb&quot; /> <fb:name uid=&quot;12345&quot; /> </h1> <hr/> <p> <fb:user-status uid=&quot;12345&quot; linked=&quot;false&quot;/> </p> ... </html>
  • 11. FBML Parser Parsed by Facebook Not parsed Brett Harris is presenting at ZendCon
  • 12. FBML Parser Proxy function smarty_function_fb_name( $params , & $smarty ) { if (Framework_Config::get( 'MODE') == 'local' ) { return 'Grant Raphael' ; } $fbml = '<fb:name ' ; foreach ( $params as $key => $value ) { $fbml .= $key . '=&quot;' . addslashes( $value ) . '&quot;' ; } $fbml .= ' />' ; return $fbml ; } http://smarty.net/manual/en/plugins.php
  • 13. FBML Parsing Mock <html> ... <h1> {fb_profile_pic uid=&quot;12345&quot; size=&quot;thumb&quot; } {fb_name uid=&quot;12345&quot; } </h1> <hr/> <p> {fb_user_status uid=&quot;12345&quot; linked=&quot;false&quot; } </p> ... </html>
  • 14. FBML Parsing Mock Grant Raphael is updating their status Parsed by Facebook Not parsed Brett Harris is speaking at ZendCon
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 24. Easier to learn <?php ... // Get the user object from FQL table $fb_user = new Facebook_User( 12345 ); // Get the user's items from local SQL table $items = Items::find( 'fb_user_id = ?' , $fb_user ->uid); ... ?> <?php ... // Get the user object from FQL table $fb_lib = new Facebook(API_KEY, SECRET_KEY); $fb_client = $fb_lib ->api_client; $results = $fb_client ->fql_query( 'SELECT uid, first_name, last_name, ... FROM user WHERE uid = &quot;12345&quot;' ); $fb_user_array = array_pop( $results ); // Get the user's items from local SQL table $items = Items::find( 'fb_user_id = ?' , $fb_user [ 'uid' ]); ... ?>
  • 25.
  • 26.
  • 27. FBML Proxy <html> ... <h1> {fb_profile_pic uid=&quot;12345&quot; size=&quot;thumb&quot; } {fb_name uid=&quot;12345&quot; } </h1> <hr/> <p> {fb_user_status uid=&quot;12345&quot; linked=&quot;false&quot; } </p> ... </html>
  • 28.
  • 29. UI Components < html > ... {Grid recordset=$recordset} {Column header=&quot;ID&quot; field=&quot;id&quot;} {Column header=&quot;Name&quot; field=&quot;name&quot;} {ColumnComplex header=&quot;Email&quot;} < a href = &quot;mailto:{$record.email}&quot; > {$record.email} </ a > {/ColumnComplex} {/Grid} ... </ html > Make a grid - 3 columns (ID, Name, Email) - Loop through items in $recordset for rows < html > ... < table > < tr > < th > ID </ th > < th > Name </ th > < th > Email </ th > </ tr > <?php foreach ( $recordset as $record ) { ?> < tr > < td > <? = $record ->id ?> </ td > < td > <? = $record ->name ?> </ td > < td > < a href =&quot; mailto: <? = $record ->email ?> &quot; > <? = $record ->email ?> </ a > </ td > </ tr > <?php } ?> </ table > ... </ html > ID Name Email 1 John Doe [email_address] 2 Steve Smith [email_address]
  • 30. Wrapping AJAX Libraries < html > ... < input id = &quot;mb1&quot; type = &quot;button&quot; value = &quot;Show Popup&quot; /> < script > Ext.onReady( function () { Ext.get( 'mb1' ).on( 'click' , function (e) { Ext.MessageBox.confirm( 'Confirm' , 'Are you sure you want to do that?' , showResult); } ); </ script > ... </ html > < html > ... {PopupButton value=&quot;Show Popup&quot; header=&quot;Confirm&quot; message=&quot;Are you sure you want to do that?&quot; callback=&quot;showResult&quot;} ... </ html > http://extjs.com /
  • 32. Make it work. Make it right. Make it fast. Make it fast. Make it fast.
  • 33. Make a framework. Make it right. Make it fast. Make it fast. Make it fast.
  • 34. Make a framework. Make it right. Use a framework. Use a framework. Use a framework.
  • 35. Make a framework. Make great FB apps. Use a framework. Use a framework. Use a framework.
  • 36.