building a facebook app to track suggestion to user friends for "liking" a page

Hi, how complex would it be to write a facebook app that does the following?

1) After the user installs it, the only purpose of the app is to suggest to the users friends that they 'like' a certain facebook page.
2) If at least 5 of their friends accept the application and “LIKE” the facebook page, automatically the user wins a coupon code
3) The user must accept the application Request for permission with the default settings from facebook and acceptance of the «Send me email» checkbox. When users “allows” the application, it should automatically make a Post in his wall, with photo, text, and link to the application
4) The welcome page of the application will show a 200 x 500 image, and a short text message with the invitation and description text of 600 characters and will explain the process and will be able to send an invitation. Underneath there should be a facebook invite box to choose which friends to send the application to actually suggest that they 'like' this page.
5) When the user allow the application will be post on the wall of the application with a short text to 250 characters and link the application. When his friends accept the invitation , it will automatically post on the wall of text 250 characters
6) When 5 of his friends like the page, we will send an automated email to the user, with a unique 8-digit alphanumerical code
7) At the same time, on his facebook wall, we will automatically post a 250 characters wall message, ie. "JOHN just won!"

We need a simple database with a list of coupons generated and a coupon cancellation function. The process is this: When the winner gets to a store to redeem his coupon, the admins will login to a website with a list of winners and their unique codes. There are 18 shops in which the coupons can be redeemed, so we need to create 18 login/password combinations with basic http authentication. When the store manager enters a coupon code, then it becomes invalid and it will no longer be valid for the rest of the stores.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
Hello darkbluegr,

Building a facebook application as you suggest would be fairly straightforward.

I would be inclined to setup a default Zend Framework application on my server.

Setup a facebook developer account.

Setup a facebook test application instance that links back to the Zend Framework Application I setup on my server.

Integrate my application with facebook's social graph.

Joseph Melnick
darkbluegrAuthor Commented:
Thanks Joseph for the detailed process

The main problem I came across was how to track the inviter of someone who likes a facebook page. Is there any way to find out if a person who "liked" the page had indeed installed our application first?

Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
Hello darkbluegr,

You should have a look at the documentation at:

I thank what you are after is in the 'Single Sign-on' section on that page an subsequent paragraphs.

Joseph Melnick

Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

darkbluegrAuthor Commented:
are there any helpful guides about implementing the stream.publish function?
Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
Hello Again,

The following links to documentation for stream publishing.

includes a  console so you can test.

Joseph Melnick
Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
A simple stream publishing example

//include facebook api
require_once 'facebook.php';

// set credentials
$appapikey = 'yourapikey';
$appsecret = 'yoursecret';

// initialize facebook class
$facebook = new Facebook($appapikey, $appsecret);

// get facebook user id
$user_id = $facebook->require_login();

// set message
$message = "some intersting message to publish";

// publish message


Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
darkbluegrAuthor Commented:
thanks, will do some more searching around but def. good pointers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.