Unskilled Forum
Welcome to Unskilled! Smile
Please Login/Register To have a full access in our site!

~ Unskilled Team/Staff!

You are not connected. Please login or register

FAQ Facebook

Go down  Message [Page 1 of 1]

1 FAQ Facebook on 10/31/2009, 06:21


There have been a lot of redundant questions, so hopefully this will eliminate those.

There are some more specific/technical questions answered on the wiki, right here:
[You must be registered and logged in to see this link.]

I know a bit about making web sites and web applications, maybe I know some PHP or Java, tell me what to do.

Go here: [You must be registered and logged in to see this link.]

How-to guides are here: [You must be registered and logged in to see this link.]

Demo apps are here: [You must be registered and logged in to see this link.]

I am a total newbie. How do I make a Facebook app?

Whoah there, that's a pretty broad question! Let's see if you can make that a little more specific based on what you already know.

Do I need to know HTML?

Yes you do. It's really not that hard, though unfortunately you need to know a lot MORE than HTML to make a Facebook application. If you want to learn HTML, I wouldn't suggest learning it while making a Facebook app, because apps are a lot more complicated than just HTML web pages.

If you search Google for "learn HTML," this is what comes up:
[You must be registered and logged in to see this link.]

You should probably try that first.
Also, for CSS:
[You must be registered and logged in to see this link.]

Okay, I know HTML, but what's this other stuff I need? PHP? What?

Okay, so there are actually a bunch of languages you can make Facebook apps in. To some, choosing is a matter of subjective preference, to others it's an obvious choice that may or may not reflect your intelligence. I personally don't pretend to know or care about what's *better*, but at any rate:

Facebook provides, via the developer wiki, a number of libraries that will allow you to set up your server to run apps. Check out the list there for more detail. Some of the most common are PHP, Ruby on Rails, Java, and Python. There's also the Javascript libraries if you want the work to be done in the browser instead of on the server.

What? Why do I need to know this stuff?

Every method of making Facebook apps (unless you're using Facebook's Javascript libraries or Connect - more on that later!) involve a server running code before it gets to the user. You (yes, you!) have to learn to program this stuff if you want to accurately translate your application ideas from your head to the internet. You also need a hosting service to provide you with a server. The most common setup is Apache (the actual server software), PHP (a server side programming language), and MySQL (a database server program).

All of these work together to make Facebook apps happen. Not coincidentally, this is how people make non-Facebook web applications too. Wee!

MySQL? Database server? Who-what?

Yup. You need a way to keep track of all the information you process. How do you think SuperPoke keeps track of who has poked who? With a database, that's how. A database stores a whole bunch of information, separated into tables, which are kind of like really specific spreadsheets that each hold a type of information. For instance, you might have a Users table with information about all people who have used your app, and a PokeType table with all the different kinds of pokes, and a PokeHistory table, which would keep track of who poked who when and with what.

See, it's already getting complicated. Bet you thought this was going to be easy!

Yeah, I did.

Well, a lot of the magic of web applications (Facebook and otherwise) goes on behind the scenes, so it's hard to tell how complex something is if you're a lay-person. If you really want to know, you have to pop the hood and be prepared to learn a lot. It all looks like gibberish when you start, but I promise you that with some good reference and a lot of patience, you can do it too.

Where do the files go? I know HTML and I know you put a page somewhere, but I'm missing something...

With HTML, using the simple kind of web site that most people start with, you put it on a server. It's at [You must be registered and logged in to see this link.] That's it.

With a web application (anything that is interactive), it might be something like [You must be registered and logged in to see this link.]

blah.php, in this case, would have some code that the server runs before sending you the final result. You don't see any of that code, just the final result.

Now there's also something called POST and something else called GET. These are the two common ways to send additional information to a web server besides just what page you want.

Let's say blah.php shows a picture of an animal. You want the user to be able to pick that animal. Somewhere else you have an HTML form that, depending on what you choose, appends ?animal=something (where something is the name of the animal they chose) to the end of the url when you click a link. So then it becomes blah.php?animal=monkey or whatever. blah.php will, somewhere, have a command that uses GET to find out that animal = monkey (or whatever.) Then the code runs accordingly.

With POST, the "animal=monkey" part is embedded in the browser's request for blah.php (when you click the link to blah.php), so your server gets a message that can be summed up as "give me blah.php, oh and also animal=monkey." Then blah.php runs accordingly if you check for animal in the POST variable.

The program in blah.php runs EVERY TIME somebody requests the page.

This is basically how web applications run.

Facebook apps allow you to keep track of users by using their code (which is why you need their libraries) to add a whole bunch of extra info to the POST part of the page request every single time a user sends it. So instead of just "give me blah.php and also, by the way, animal=monkey", you get that plus "the id of the user trying to get this page is 23859393 and here's a bunch of other useful information."

The pre-requisite for making a php page run (or whatever language you're writing in) is that the server has to KNOW that it's a php page, and the server has to know which parts of the code to run. Just like how you need a script tag in HTML to use Javascript, you need a ?php tag in your .php files so the server knows that you've got code to run before sending the file off to the user.

So, to answer the question, you need a server that knows the language you're writing in, and you need to write the code in that language properly. Many web hosting services run PHP by default, and may or may not support other languages. You'll have to check with them. It's also possible to set up PHP, Ruby, Python, etc. on your own computer for testing purposes while you're still learning the language, but for many reasons it's not a good idea to try to use your home computer as a web application server. Mac OS X comes pre-packaged with an Apache web server and installations of php, mySQL, Java, Python, and Ruby. Python and Ruby are great for writing web applications but both require additional installation and set up to get their web server implementations up and running ( [You must be registered and logged in to see this link.] for Ruby or [You must be registered and logged in to see this link.] for Python... those are the more well known ones. )

So I'm confused. I get to an app by going to apps.facebook.com/appname, but it's actually on another server? What if I already have a web site in PHP/Ruby/Python/Java/whatever?

App pages displayed inside Facebook are basically just reinterpretations of code from your server. Facebook requires your PHP file, your server runs PHP and delivers that file to Facebook, and Facebook either displays it exactly (in an IFRAME) or interprets it (using FBML, including interpreting special FBML tags that give canvas pages some more functionality).

How you adapt something for Facebook depends what sort of page you have now. Highly-specialized PHP (or a site that already has users logging in for some purpose) will be harder to make appropriate for display on Facebook (Facebook applications should have some 'social' features, things that use Facebook's API to make an application user be able to interact with his/her friends somehow. They won't be very successful if they just relay static data from a site, or do something that a user shouldn't have to log in to do).

There's also now Facebook Connect available, as well as the Facebook Javascript libraries. If you've got a Connect site, you HAVE to learn the JS library. If you've got an iFrame app, you can use the JS library get a lot of FBML functionality outside of a 'real' FBML page. Go here for more details:
[You must be registered and logged in to see this link.]

check this out
[You must be registered and logged in to see this link.]

If you know a fair amount of Javascript (or want to learn it), you can get a lot out of Facebook's Javascript libraries and/or Facebook Connect.

Oh yeah, I've heard about Connect. What's that about?

Facebook Connect is basically a way to use the Facebook API and get the kind of features apps get without actually being an app run inside Facebook.

Basically, all of the features that make Connect work on any web site can also be used in an app set up as a Facebook application. What this means in english is that you DON'T have to learn a server-side programming language if you already know Javascript and want to have a Facebook app. Pretty cool, eh?

Everyone has a cool idea for a Facebook app. Unfortunately, as you may have noticed, this isn't easy and it takes some time. If your idea is so cool that you must make it happen, you'll either have to pay full price or learn how to do it yourself. Sorry.

I made a Flash game. Is it easy to port it to Facebook?

If you don't want to add any extra features it all, it's not too hard. If you want to start having the high scores update on peoples' profiles and stuff like that, get ready to do a lot more work.

If you want to make Facebook API calls from Flash, there are a few ways to do it.
Facebook and Adobe teamed up to make an official Actionscript/Facebook API. That's here:
[You must be registered and logged in to see this link.]

There's also a lightweight Javascript/AS3 bridge:
[You must be registered and logged in to see this link.]
This was made by Zerofractal, who posts on these forums. I use it and it works great.

I can't get my flash app/some other complicated thing onto my profile. What gives?

To prevent spam and abuse, Facebook has limited what can go on user profiles. If you try to embed Flash, for instance, it will not run when the page loads; Instead, users will have to click on it first.

Check out the article on the wiki called Changing Profile Content.

Last edited by admer on 11/10/2009, 12:22; edited 1 time in total

[You must be registered and logged in to see this image.]

2 Re: FAQ Facebook on 11/10/2009, 11:54


Unskilled Fool
Unskilled Fool


3 Re: FAQ Facebook on 11/10/2009, 12:23


faith:) wrote:aray


[You must be registered and logged in to see this image.]

4 Re: FAQ Facebook on 12/17/2009, 15:10


Unskilled Elite
Unskilled Elite
w0w. xD affraid haha


5 Re: FAQ Facebook on 4/4/2010, 14:17


ok too many to read thanks for sharing!


Sponsored content

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum