₦airaland Forum

Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,295,592 members, 5,043,196 topics. Date: Thursday, 18 July 2019 at 01:41 AM

Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps (1901 Views)

Gtbank Gtpay Magento Payment Module Integration, Ready!!! / Payment Gateway Integration (interswitch / Mastercard / Visa) / Interswitch Web Site Integration: (2) (3) (4)

(1) (Reply) (Go Down)

Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 12:32pm On May 06, 2008
Now this is no longer news that facebook may be the most successful online social networking website ever in human history.

But what may be new and news to you is that as a web developer you can make quick and lucurative income writing B2C(Business to Consumer)Integration applications for facebook.

WIll be back to provide ya'all wit hthe details,right now i need a lunch break.
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by georgen2u(m): 3:07pm On May 06, 2008
that is very good we would like to know more man i have a cat to let out so speed up we are waiting ok?
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 12:12pm On May 07, 2008
According to Alexa, Facebook is one of the top 20 sites on the Web, and it has some impressive statistics:


The site's growth is around 3% per week, which equates to 100,000 new users per day.
50% of registered users visit the site every day.
The site attracts more traffic than eBay: 40 billion page views per month, which equates to an average of 50 pages per user, per day.

Just looking at these statistics should start you thinking about the ways in which you can leverage this level of traffic to benefit your own web site. If you could tap into the Facebook userbase, you could very easily and quickly increase the audience's awareness of your brand, product, service, or web site.

Let's consider a real-world example. I'm currently working on welovelocal.com, a UK directory that allows its users to find and review businesses. While this isn't necessarily a new idea, the site adds a social element whereby users can view reviews from their friends to find out about businesses that other users with similar interests are reviewing. And by leveraging Facebook, a site like this can significantly increase its exposure to a given user's network of friends.

For example, if Stacy, a welovelocal user, writes a review about a restaurant, that review will be published to Stacy's Facebook news feed. All of Stacy's friends on Facebook will be able to see that she's written a new review, and can click through to welovelocal to read it.

Can you see the potential?

You can work with the Facebook Platform in many ways, including creating apps that exist just within Facebook itself. However, I feel that the greatest potential lies with integrating Facebook into an existing site, and that's what I'll cover in this article.

The news feed is perhaps the most important element of the platform, as it adds a real viral element to any kind of notification you send out -- being able to reach the entire network of friends for any of your users is certainly a great feature. But there are many other avenues by which content can be communicated to users. For example, you can:


Add a link to your own site from the left-hand menu bar of a user's Facebook profile page, as shown below.

Add to a user's profile a content box that contains whatever content you like. With welovelocal, we use this to display the user's latest five reviews, complete with ratings and links back to the actual reviews on our site, as shown here.

Send requests to users to perform certain actions. For example, you could retrieve a list of your users' friends, and send a request to all of them to add your app to their Facebook profiles.
Upload photos, create albums, get photos, and manage photos within Facebook. One use for this might be to access the photos a user has added to their Facebook account and pull them into your site, or to push photos that have been uploaded to your site back to Facebook.

How Do I Use It?
In this article, we'll walk through the basics of using the Facebook platform using PHP 5. If you're interested in integrating your site with Facebook using another language, there is plenty of information on the Facebook developers' wiki:


ASP.NET
ASP(VBScript)
ColdFusion
C++
C#
Java
Perl
PHP
Python
Ruby on Rails
VB.NET

I was fortunate (or unfortunate) to develop the welovelocal application prior to the official platform release in May. This meant that I had to write my own code to call the functions. There is an official PHP 5 library as well as an unofficial PHP 4 version (see the PHP link above) that you can probably use to get up and running more quickly and easily than I did. However, in order to gain a proper understanding of how the platform works, it's worth looking at the raw interactions that take place.

First Steps
You must register for an API key before you can access the Facebook Platform. To do this, you'll need to sign up for a Facebook account, then add the "Developer" application to your Facebook account. You can do so by following the very simple instructions at www.facebook.com/developers. Once it's added, you'll find that the Developer application is very much like a normal Facebook group, but it has an additional link near the top of the page called "My Applications" which, when clicked, will display a list of all the Facebook applications that you have registered.

Once you've registered, you need to generate a key. Click the Apply for another key link and you'll be walked through the process of creating a Facebook application. There are a number of fields that you can provide optional information to, all of which are explained in the quick start guide on the Facebook Developers site.

Your application is actually now ready to be used, although it won't do anything! Depending on what you want your application to do, your users may need to perform a number of steps to install your app into their Facebook accounts. The process usually consists of them clicking an Install link, then confirming the request, as shown here.

Adding an application to a Facebook account (click to view image)

Once the application is added, it will appear in the user's news feed and on their mini-feed, both of which are viewable by all their friends -- your first bit of free publicity!

Authentication
Your application is ready to be used, but of course you'll want to provide some content for your user. The two most important features for web site owners are:


the ability to publish items to the news feed
the ability to add a profile box

Before you can use either of these pieces of functionality, you need to authenticate the current user with the Facebook platform.

Each call to the Facebook Platform API requires a session key that identifies the user who's logged in and is using the system. To obtain this key, you must make a call to the Facebook API that redirects the user to log in to the Facebook web site and authorize the request.

One hurdle here is that this authorization provides a session key that only lasts for a certain period of time -- around 24 hours. A key that didn't expire would be much more useful. Fortunately, we can obtain such a key by following these two steps, which I'll explain in more detail in a moment:


First, ask the user to authorize your application so that it can access the user's account on Facebook. This returns auth token 1, which generates a session key that expires after 24 hours.

Then, ask the user to generate auth token 2, which they should then paste into a form on your web site. With this token in place, you'll be able to generate a session key that never expires.

Once you have the final token, you can request a permanent session key by calling the facebook.auth.getSession function.

But first, allow me to elaborate on those two steps.

Step 1 - Obtaining Auth Token 1

From your web site, direct your user to Facebook using a URL appended with your API key, like this: www.facebook.com/login.php?api_key=APIKEY (where APIKEY should be replaced with your own API key). If the user is not currently logged in, they'll be asked to do so.

The user will then be asked to accept any terms of service you set, and will be redirected to the callback URL that you specified when creating the application. This can be changed by editing your application through the Developer link in Facebook's sidebar.

With the redirect in place, Facebook will append ?auth_token=TOKEN to the URL, using an actual authentication token. You can use this token with the facebook.auth.getSession function; it's available as a GET variable in PHP.

However, because we want to get an infinite session, that auth token is actually irrelevant -- we need to get another token that we can use to get a permanent session key. If we were not interested in an infinite session, this is where we would stop. We could use the auth token with the facebook.auth.getSession function below.

Step 2 - Obtaining Auth Token 2

Once your user has returned to your site after logging into Facebook, you'll need to send them to www.facebook.com/code_gen.php?api_key=APIKEY. Back on the Facebook site, the user will be asked to generate a token that will be displayed to them. They must then copy and paste it into a form on your web site -- it's not passed through via GET/POST. It's up to you to create a form that accepts this token from your user.

Once the user has submitted this second token to your site, you'll need to call the facebook.auth.getSession function, passing the token as a parameter. This will finally return a session key that you can use continuously to authenticate that user; this key could, for example, be stored in the database alongside the user's account for easy retrieval in the future.

It's important to note that, should the user delete your application from their Facebook account, they'll need to repeat this authentication process in order to use your Facebook application. You should therefore provide the option for the user to reset their Facebook integration and set it up again. If you're storing the user's session key in the database, this task would simply involve deleting that session key and taking the user through the two-step authentication process above.

Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by georgen2u(m): 3:24pm On May 07, 2008
is it not waste of time? why not develop your own social network site just like face book or any other?
i am working on my own and will soon be out
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 5:18pm On May 07, 2008
georgen2u:

is it not waste of time? why not develop your own social network site just like face book or any other?
i am working on my own and will soon be out

@ georgen2u

Honestly i think,you are the one wasting your time tryint to write a fresh new social networking website.The plain truth is that the success of social networking website goes beyond just design.I hear about tons and tons of new Nigerian social neworking websites everyday.

And the pathetic this is most of them always rely on revenue form Google Adsense and other residual income oriented programs.Social networking in Nigeria is still a BIG JOKE.

Legwork.com.ng seems to be the only Nigerian social network that seems to have broken the jinx.Well i wish you good luck but i can bet that i'll make more revenue writing facebook integration apps than you writing your own fresh social network website. grin
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by aphoe(m): 9:36am On May 08, 2008
its not always advisable to start building from scratch. the only reason i would encourage anybody to start a new social networking site project from scratch is if he has a new idea that has never been implemented by any of the available sites.

i tell u, building an application into facebook might be far more lucratiive than designing ur own site from scratch. except if u have a very good idea that is sure to sell don't attempt it

always try to apply the OOP concept of inheritance
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by georgen2u(m): 5:06pm On May 10, 2008
very interesting but i may suprise you that i am a scripts nuller, i have a face book clone script for the purpose of genuity i will email one to you its just like face book its just that i used php5 so if you need it i can send it for ur examination
cheers
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 4:56pm On May 11, 2008

georgen2u:

very interesting but i may suprise you that i am a scripts nuller, i have a face book clone script for the purpose of genuity i will email one to you its just like face book its just that i used php5 so if you need it i can send it for your examination
cheers

I guess you are yet to face the realities of dot com ventures.Their are a lot more to successful social networking website that to have clones or writing super excellent codes.

Welcome to the hard knock life man.
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by georgen2u(m): 5:18pm On May 12, 2008
very gud but even though i streem my ads from google what i need is money even tah and Hi5 are doing the same i added another API for advertising so that i can have mine own similar face book method of ads see by the time i lunch it level go Change
Regards
Digital Admin,
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 5:32pm On May 12, 2008
Can i ask a simple question ?Is your so called social networking website running ?If yes lets see the url to put it to the litmus test.

If it is yet to go live,then i strongly believe you are building castles in the air my friend.I still remain adamant that its a lot more lucurative to write facebook apps than waste time coding a social networking site that will not even get up to 100 hits a day.
grin
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by Afam(m): 5:51pm On May 12, 2008
tundewoods:

Can i ask a simple question ?Is your so called social networking website running ?If yes lets see the url to put it to the litmus test.

If it is yet to go live,then i strongly believe you are building castles in the air my friend.I still remain adamant that its a lot more lucurative to write facebook apps than waste time coding a social networking site that will not even get up to 100 hits a day.
grin

If the owner of Facebook listened to your advice then we wouldn't have seen anything like Facebook.

Those who have made marks in the world today started out with dreams, dreams that others laughed at but at the end of the day the dreamed transformed into reality.

Do not attempt to kill anyone's dream as dreamers have all it takes to rule the world.

@georgen2u,

If you believe in your dreams by all means do all you can to see them through, God willing your dreams will become reality and successful.
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by damola1: 6:10pm On May 12, 2008
Well, if you believe you can achieve, by all means, go ahead and achieve it.

but be sure to know what you are doing, even the so called Facebook is not making money yet!, they are still finding out HOw to make money, microsoft had to come to their aid last year.

but , who they f**k am I to advise you, nobody!!, stories of the most successful people has and will continue to sound like a miracle!!,
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by georgen2u(m): 4:31pm On May 14, 2008
that is very encouraging for now i am planing to lunch it but its just that i am looking for a compitent web hoster the ones i have ssems to be billing costly the only one i found to be a little freindly is web4africa with the the list plan of 1 gig Space and 10 gig of trnsfer but N5000, i need any cheap realiable web hsoting atleast with 10 gig of space and 50 gig of transfer can any one recommed any for me
i need to host this special Nigeria Face book?
Thanks
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 11:36pm On May 14, 2008
georgen2u:

that is very encouraging for now i am planing to lunch it but its just that i am looking for a compitent web hoster the ones i have ssems to be billing costly the only one i found to be a little freindly is web4africa with the the list plan of 1 gig Space and 10 gig of trnsfer but N5000, i need any cheap realiable web hsoting atleast with 10 gig of space and 50 gig of transfer can any one recommed any for me
i need to host this special Nigeria Face book?
Thanks

@ georgen2u

Excuses,Excuses & more Excuses are the major reasons why persons fail in business,learn that today if you have not done so.Secondly allowing people to massage your Ego will not do you any good.If guys on this forum think your idea will fly.I am sorry to sound paranoid but i can bet a million bucks that it wont embarassed (sorry but im being frank)

Now your so called given excuse for not starting your naija facebook is due to cost in terms of affordability of web hosting space,then you have a long road to walk.There thousand of affordable web host scattered on the internet,i wonder why finding a host that can provide you 10GB space is a problem.I personally use a 200GB shared host and the price is quite affordable.

Any way keep us posted on your social networking website Ok,Now let me get back to the reason why i started this thread in the first place.
Re: Lucurative & Heavy Demand: Writing Facebook B2c Integration Apps by tundewoods(m): 11:58pm On May 14, 2008


DEVELOPING YOUR VERY FIRST FACEBOOK APP .

Facebook provides PHP and Java client libraries. You can download the PHP libraries at http://developers.facebook.com/clientlibs/facebook-platform.tar.gz and you can download the Java libraries at http://developers.facebook.com/clientlibs/facebook_java_client.zip.

For information on where to download libraries provided by the Facebook community, follow the links under Language-Specific Libraries. Instructions also follow in the next section.

Once you set up your environment, you need to prepare the server that will host your Facebook application.

Setting Up Your Server
In order for your application to work correctly with Facebook, you need to take the following steps to prepare your server.

1. Verify that your server can serve an HTML file. That is, make sure you can view a file from a browser on a computer that is not your server.

2. Upload the appropriate Facebook client library to your server. See above for more information.
For example, if you are developing your application with PHP, its client libraries are available at http://developers.facebook.com/clientlibs/facebook-platform.tar.gz. Untar the archive then upload the PHP files to your server. You need to include these files in your PHP code.

3. If your application stores user or application information in a database, install a database such as MySQL on your server. For more information on MySQL, see the MySQL website: http://dev.mysql.com/doc/mysql/en/index.html.

4. Verify that you can write a database program outside of Facebook Platform. For example, try out the counter program available at http://developers.facebook.com/step_by_step.php#counter. If the counter works, then you are ready to go!
In the meantime, you can take a look at some demo applications.

Adding the Facebook Developer Application
To add the Facebook Developer application, go to http://www.facebook.com/developers and click Add Developer. Once you add the Developer application, the My Applications page appears. This page contains links for downloading the client libraries and a sample application. With Facebook's Developer application, you can:

[list]

[li]Request up to 100 API keys, customize your application settings, and create and manage the applications you have developed from right inside Facebook.[/li]

[li]Connect with the developer community through the discussion boards and find local developer events.[/li]

[li]Find the reference material you need, including links to client libraries, sample code and sample applications, to help get you started.[/li]

[li]Check out the the Facebook Developers News Feed (at http://developers.facebook.com/news.php?blog=1&format=xml) for the latest news on upcoming features and events, and the Facebook Platform Status Feed (at http://www.facebook.com/feeds/api_messages.php) for the current status of Facebook Platform. You can subscribe to these RSS feeds for the most up-to-date information. [/li][/list]

Creating Your Facebook Application
Once you've added the Facebook Developer application to your account, you can begin creating your first application for Facebook. Coding aside, creating an application takes just a few minutes.

1. From the Facebook Developer application's home page, click +Set Up New Application. The New Application page appears. Enter a name for your application in the Application Name field. The name cannot be longer than 50 characters and cannot contain the word “face.”

2. Follow the Facebook Platform link and read the Facebook Platform Terms of Service. Go back then check the box to confirm that you agree to the terms.
Even though these are the only required fields, providing more information makes your application much more interesting to users. Click the Optional Fields link to see more entry fields.

3.You need to provide an email address in the Developer Contact E-mail field. Facebook uses this address if it needs to contact you about your application. This address can be seen only by Facebook staff. Facebook populates this field automatically with the email address tied to your Facebook profile, but you can use a different address if you so choose.

4. You need to provide an email address in the Support E-mail field. Any messages your users send from your application's help page are sent to this address. Facebook populates this field automatically with the email address tied to your Facebook profile, but you can use a different address if you so choose.

5. In the Callback URL field, enter the URL of the directory on your server where you plan to create your application. The callback URL serves two functions.

6. It's the page where you can redirect a user after that user successfully logs in to your application.
Note: Logging in to an application is different from adding one, as a user can log in to your application without adding it. Logging in serves to authenticate a user so that your application can take actions based on who the user is, while adding an application actually integrates it into his or her Facebook account.
This URL also serves the content for your canvas page (the home page for your application) to Facebook.

7. The callback URL cannot be longer than 100 characters.
Enter the name at which you'd like your application to be hosted inside Facebook in the Canvas Page URL field, omitting any spaces. Facebook recommends that you use your application name or something similar for this URL. The canvas page name must be unique.
The canvas page URL provides a way for an application to live inside the Facebook frame, although Facebook doesn't actually host the third-party content (except for some caching of images to assist with performance). Canvas pages are surrounded by the Facebook frame, and any development requested within the canvas page URL get served out of the callback URL.
The canvas page is also where the FBML gets rendered. FBML does not get rendered on your server; it only gets rendered within Facebook, which is why it's a good idea to allow your application to be added to Facebook.
For example, if your callback URL is example.com/ and your canvas page URL is apps.facebook.com/pokewall/, then apps.facebook.com/pokewall/poke.php requests example.com/poke.php.

8. If you are using FBML to render your canvas page, select the Use FBML radio button. If you are not using FBML and plan to use your servers to render your canvas page, select the Use iframe radio button. Your canvas page is rendered in an inline frame in the user's profile.
If you are using FBML in your canvas page, Facebook's servers render the content of your application before presenting it to the user.
9. If your application is going to run in a user's Web browser, select Website for Application Type. Otherwise, if the application is going to be downloaded to your user's desktop and run from there, select Desktop.

10. If you want Facebook to integrate your application so that it can be used on a user's mobile device, check the Mobile Integration check box. Facebook provides additional functionality for applications that run on mobile devices.

11. If your application is Web-based, in the IP Addresses of Servers Making Requests field, you can enter the IP addresses of your servers that can access Facebook's servers and serve information to your application. For multiple IP addresses, separate each address with a comma. Facebook rejects any requests for your application from IP addresses other than those you listed.
This is useful for security, as it prevents other applications from impersonating yours if they steal your secret key. However, it also prevents you from testing your application through localhost.

12. If you want your users to be able to add your application to their Facebook accounts, select Yes next to Can Your App be Added to Facebook. More options appear, allowing you to specify installation options and integration points for your application. See below for more details.
Otherwise if you plan to run your application on an external website and make calls to Facebook choose No.

13. If you are providing terms of service for your application, enter the URL to that page in the TOS URL field. Any user adding your application must accept your terms before adding it.

14. If there are other developers working on this application with you, enter their names in the Developers field. They can modify your application. They must be your friends before you can add them here.

15. If your application gets rendered in an iframe, decide whether you want the iframe to be smartly sized or resizable and choose the appropriate radio button. A smartsized canvas page iframe fits the remaining space on the page when it loads, but the applicaton cannot change the size of the iframe in case the content changes size. For more information, see Resizable IFrame and fb:iframe.

16. It's a good idea to add an icon for your application. This icon appears in the left side nav beside your application name. The icon must be 16 by 16 pixels. Click Change your icon and browse for one.

At this point, you can either save your application or continue configuring installation and integration options, as needed. Either click Submit to save it or continue to the next section.

(1) (Reply)

Free Domain!!!!! / Pls What's The Cheapest Platform To Send Bulk Emails / Follow Up On Hilary Iwenofu Of H.I.T Technologies Scam Allegations

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (0) (1) (2) (3) (4) (5) (6) (7) (8) (9)

Nairaland - Copyright © 2005 - 2019 Oluwaseun Osewa. All rights reserved. See How To Advertise. 211
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.