200 likes | 333 Views
Facebook apps with a ColdFusion backend. Simon Free @simonfree. www.cfunited.com. What to expect. Why would you make a Facebook application? The differences between a platform and an API The registration process Your first roadblock A look at FBML Digging into the API CF is your glue
E N D
Facebook apps with a ColdFusion backend • Simon Free • @simonfree www.cfunited.com
What to expect • Why would you make a Facebook application? • The differences between a platform and an API • The registration process • Your first roadblock • A look at FBML • Digging into the API • CF is your glue • The new, dreaded, Extended Privacy • Useful resources www.cfunited.com
Why would you make a Facebook application? • Viral Marketing • Drive traffic • Add features to your current site www.cfunited.com 3
The differences between an API and a Platform www.cfunited.com
The workings of a Facebook App www.cfunited.com
The setup process - Step 1 • Name your application www.cfunited.com 6
The setup process - Step 2 • Make note of your API Key and Secret Key www.cfunited.com 7
The setup process - Step 3 • Set up your url and canvas information www.cfunited.com 8
The setup process - Step 4 • Select required sandbox mode and provide apple ID if necessary www.cfunited.com 9
The setup process - Review www.cfunited.com
Your first roadblock • Validation is carried out on form fields that have specific names (pre cf9) <cfscript> if(structKeyExists(form,"fb_sig")){ form.fb_sig_local = form.fb_sig; form.fb_sig = ''; } </cfscript> www.cfunited.com
A look at FBML • Tag system that handles output of data • Tags display data just as the web site does • Tags are mostly used for UI and layout • Conditional logic tags do exist Example Tags: <fb:action href="action.cfm">Click Me!</fb:action> <fb:profile-pic uid="12345" linked="true" /> <fb:user uid="12345" /> <fb:captcha /> www.cfunited.com
Lets look at some code! www.cfunited.com
Digging into the API • RESTful-ish API • Dot delimited methods • Methods grouped in actions • Returns XML, JSON or Facebook PHP Client • Access to fql (similar to SQL) • API Key, Call ID, MD5 Hash of Secret Key and Version needed for every request www.cfunited.com 14
Lets look at some code! www.cfunited.com
CF is your glue • Use API to get Data • Parse and loop over data with CF • Output using FBL • Store data associated with uid with CF and SQL www.cfunited.com 16
Lets look at some code! www.cfunited.com
The new, dreaded, Extended Privacy • Users can now choose to hide: • Picture • Name • Profile www.cfunited.com 18
Useful Resources • Facebook developers Wiki • http://wiki.developers.facebook.com/index.php/Main_Page • Facebook Get Started Section • http://developers.facebook.com/get_started.php • Facebook Developers Tools • http://developers.facebook.com/tools.php www.cfunited.com 19
Thats all folks! Questions / Comments? Simon@simonfree.com Slides will be available at: http://www.simonfree.com/presentations/ Follow me on twitter: http://www.twitter.com/simonfree www.cfunited.com