Manual Reference Pages - FACEBOOK::GRAPH::COOKBOOK::RECIPE2 (3)
Facebook::Graph::Cookbook::Recipe2 - Building a Full Web App
A full working web app for those people who like to start hacking from a working example and make it their own.
Youll need to have all of the following modules installed in order to run this app (in addition to Facebook::Graph):
DateTime::Format::ICal Dancer Template Data::ICal XML::FeedPP
This recipe assumes that you have a Facebook (<http://www.facebook.com>) account.
Youll also have to be able to point a domain name to a server that is accessible from the Internet. DNS and server configuration are way beyond the scope of this document.
In order to edit this web app youre either going to have to know or be willing to learn Dancer. Its a good little web app server. You can find out more at <http://perldancer.org>.
Step 1: Set up the developer application on Facebook.
Go to <http://apps.facebook.com/developer>.
Step 2: Create your application.
Go to <http://www.facebook.com/developers/createapp.php> or click Set Up New Application from the developer application.
Fill in an application name. The only restriction is that it cant use a Facebook trademark or be similar to official Facebook application names.
Agree to the terms of service.
Click Create Application.
Step 3: The Connect tab.
After creating your application, go to the Connect tab.
Fill in the Connect URL field. It should be http://www.yourapplication.com/. It is the base URL to where youll be deploying your application. The trailing slash is required.
Step 4: Note your application settings.
You either want to make note of your Application ID and your Application Secret or bookmark this page so you can come back to it. Youll need these later.
Step 5: Copy files.
If you dont already have it downloaded, download a tarball of Facebook::Graph and extract it:
tar xfz Facebook-Graph-0.0700.tar.gz
And copy the files from eg/recipe2 where ever you want to deploy your app. For this example well assume you want to deploy from /opt/webapp.
mkdir -p /opt/webapp
cp -Rfp Facebook-Graph/eg/recipe2/* /opt/webapp
Step 6: Configure your app.
Before we can run the app we need to edit the config file.
Specifically we need to set the app_id and secret fields with information from our Facebook application settings page. And we need to update the postback with the domain pointing to our server.
Step 7: Start it.
To start the app just type the following command:
Step 8: Play with it.
Go use the web app. See what it does. Point your browser to:
Step 9: Start tinkering.
Now that you know you have a working app, start tinkering. Make it do what you want it to do.
If you would like a step by step as to how this app was created, download the PDF presentation (<http://www.madmongers.org/talks/writing-facebook-apps-in-10-minutes-or-less>) I gave of this app at MadMongers (<http://www.madmongers.org>).
For more recipes, check out the Facebook::Graph::Cookbook.
Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (<http://www.plainblack.com>) and is licensed under the same terms as Perl itself.
|perl v5.20.3 ||FACEBOOK::GRAPH::COOKBOOK::RECIPE2 (3) ||2014-09-08 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.