Facebook application data storage - facebook

I created a Facebook app(game) in JavaScript. I used Facebook's php-sdk. I dint make a good use of the sdk except to display the name of the user logged, and his details.
I want to store the score of each user at some place. Checked FQL. As far as I saw, it doesnt allow you to store data, there was only SELECT query available. So is there any way in which we can append the score to user information or something similar.
In short can we store the data on Facebook
OR
We should use our own database server only to store the data.

In general you need to store your own data. While it might be possible to fake it by using some attribute of a user, it's certainly not the way it's designed to work and you can't count on the data always being available. You are better off setting up your own database and use the users' FB IDs to tie the info together.

Facebook now supports posting scores via scores api found here.
You can also publish achievements relevant to the game as in here
These have enough guidance to help you out !

Related

Storing Facebook Data

I know there have been numerous questions regarding Facebook's policies in which we can store information into our application's database. I have looked at Storing Facebook API data and also have looked at https://developers.facebook.com/policy/ but I just want to ensure that I am not violating Facebook's terms of use. I want to store a user's objectID in order to get certain information about them for use on another screen on my application (namely their profile picture) into my database. I was wondering, is that considered okay? I have looked around and haven't seen anything explicitly speaking about storing a user's objectID so I just wanted to confirm this would be okay. If this is not okay, would any one have any suggestions on how I can get a specific user's profile picture? Thanks!
I believe for Facebook's API things like a user's object ID is actually just an ID for that user for specifically your application. Meaning, you have a unique ID for a user that is completely different than the ID that Facebook uses internally or that another application has for the same user. So unless I terribly misunderstand, you can and should store that.

can i use the facebook data for my data mining project

First i will tell what i want to achieve in my data mining project and then i will ask questions.
I am thinking of using the facebook to find particular user from particular location and from particular community. Then based upon their daily wall posting and likes , dislikes i want to generate a report on what user of particular community are doing or interested in.
Is that legal , i mean can i use my crawler to grab those users public data.
Read the Facebook Terms of Service.
That is what they are for, they tell you what you are allowed to do on their site and what not.
Most likely you are not allowed to access the web site with spiders, and the Facebook API will restrict your data gathering capabilities with rate control etc. except for users that are running your application (or you pay for the data...)

Best practices for Facebook integration using the graph API

When it comes to integrating your site with facebook, is it recommended to save all the user's info from Facebook to your DB, or is it recommended to query in real time all the info you need based on the user's id?
For example the avatar sizes are different on my site than on my facebook, so I may have no choice but to download the fb avatar, but for other things like name, gender, hometown, I was wondering if I need to save that data.
Also, if I decide to change extended permissions at a later time, is that going to be an easy task?
The choice of whether to cache or re-query is totally dependent on your requirements. If you absolutely need the name to be exact then you should re-query every time. I worked on an facebook application that just didn't care about most user details so we didn't even store them let alone cache them.
Extending permissions is pretty easy.

Can you store facebook users' data and for how long?

Hi
I am developing a facebook app that involves the use of the user's email and ID. Storing users’ info to database is a more efficient approach for the purpose of the app. I am wondering if I am allowed to do this. I have read that facebook does not allow the storage of any kind of user's data for more than 7 days, however officially facebook website does not seem to mention this. Do you have any information about this issue?
The official policies are here. One relevant paragraph is:
"You may cache data you receive
through use of the Facebook API in
order to improve your application’s
user experience, but you should try to
keep the data up to date. This
permission does not give you any
rights to such data."

General sense of how to do this with Facebook Connect

I am working on a web site that lets members sign up for classes... and I'd like to implement Facebook Connect in some way so that when someone enrolls in a class, it can pop up a window and say "hey, 12 of your friends are also enrolled!" and show the friends.
I know this is possible, but in looking at the Facebook Connect docs, it's a bit confusing about how to do it.
I don't need specific code or anything like that... but I'd love a general sense of how to do this, or even some rough meta code.
So the answer I'm looking for would be something similar to: "first you need to authenticate the user by calling this facebook api call (link), then that will return their ID, which you need to keep in your app's local database... then you give facebook a list of all the IDs you know, and facebook will build a list of their friends that match, by using this api call (link)" etc...
I just need enough so I can see "the big picture" and then start to actually write some code and string all the pieces together. Facebook has great API docs but sometimes the context of the calls (i.e. WHEN I would use certain calls, and under what circumstances, like this!) is pretty vague.
thanks--
E
Quite simply, once the user has authenticated your application, you store the user's ID in your database. When user is logged in via Connect, you can use Friends.getAppUsers to return a list of users who have also authenticated the application and are also the authenticated user's friends. You could then compare those IDs with the IDs in your database table that stores user IDs and associates them with class IDs (I'm assuming each Class has an ID/table).
Check out the overview on providing social context in the documentation for more: http://wiki.developers.facebook.com/index.php/Connect/Providing_Social_Context