GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Facebook::Graph::Cookbook::Recipe2(3) User Contributed Perl Documentation Facebook::Graph::Cookbook::Recipe2(3)

Facebook::Graph::Cookbook::Recipe2 - Building a Full Web App

version 1.0801

A full working web app for those people who like to start hacking from a working example and make it their own.

You'll 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.

You'll 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 you're either going to have to know or be willing to learn Dancer. It's a good little web app server. You can find out more at <http://perldancer.org>.

Go to <http://apps.facebook.com/developer>.

Click "Allow".

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 can't use a Facebook trademark or be similar to official Facebook application names.

Agree to the terms of service.

Click "Create Application".

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 you'll be deploying your application. The trailing slash is required.

Click "save".

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. You'll need these later.

If you don't 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 we'll assume you want to deploy from "/opt/webapp".

 mkdir -p /opt/webapp
 cp -Rfp Facebook-Graph/eg/recipe2/* /opt/webapp

Before we can run the app we need to edit the config file.

 cd /opt/webapp
 vi config.yml

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.

To start the app just type the following command:

 cd /opt/webapp
 perl app.pl

Go use the web app. See what it does. Point your browser to:

 http://www.yourapplication.com/

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.
2014-09-08 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.