Title: Facebook apps with a ColdFusion backend
1Facebook apps with a ColdFusion backend
www.cfunited.com
2What 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
3Why would you make a Facebook application?
- Viral Marketing
- Drive traffic
- Add features to your current site
www.cfunited.com
3
4The differences between an API and a Platform
www.cfunited.com
5The workings of a Facebook App
www.cfunited.com
6The setup process - Step 1
- Name your application
www.cfunited.com
6
7The setup process - Step 2
- Make note of your API Key and Secret Key
www.cfunited.com
7
8The setup process - Step 3
- Set up your url and canvas information
www.cfunited.com
8
9The setup process - Step 4
- Select required sandbox mode and provide apple ID
if necessary
www.cfunited.com
9
10The setup process - Review
www.cfunited.com
11Your first roadblock
- Validation is carried out on form fields that
have specific names (pre cf9)
ltcfscriptgt if(structKeyExists(form,"fb_sig"))
form.fb_sig_local form.fb_sig form.fb_sig
'' lt/cfscriptgt
www.cfunited.com
12A 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 ltfbaction href"action.cfm"gtClick
Me!lt/fbactiongt ltfbprofile-pic uid"12345"
linked"true" /gt ltfbuser uid"12345" /gt
ltfbcaptcha /gt
www.cfunited.com
13Lets look at some code!
www.cfunited.com
14Digging 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
15Lets look at some code!
www.cfunited.com
16CF 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
17Lets look at some code!
www.cfunited.com
18The new, dreaded, Extended Privacy
- Users can now choose to hide
- Picture
- Name
- Profile
www.cfunited.com
18
19Useful 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
20Thats all folks!
Questions / Comments? Simon_at_simonfree.com Slides
will be available at http//www.simonfree.com/pre
sentations/ Follow me on twitter http//www.twit
ter.com/simonfree
www.cfunited.com