I am creating a travel planning website and I would like to have a block for users that have connected with Facebook Connect. The block would display a list of links that would say "Plan a trip to..." and then it would list a destination that was parsed from their profile data. So, I would have a list of destination names and I would match against that and provide links to create a trip node for that destination. While I know that some of this, like the destination list and parsing is outside the perview of these modules, does DFF provide some way to pull back the user's data so that it can be parsed like that?
One example of a site that does something similar is http://www.welcometofc.com/ which pulls pictures and and profile data and incorporates it into a flash "trailer".
Thanks in advance.
Comments
Comment #1
Dave Cohen commentedBrowse the facebook developer wiki. See what you can learn from the API. Check out the FQL queries which are the most flexible ways to get at facebook's data. At least the data they are willing to share.
Then, use Drupal for Facebook to set up Facebook Connect. Once you have facebook connect on the pages, write a custom module to do the FQL queries (or whatever). On each page, you'll have a global variable called
$fbwhich let's you access facebook's API.Make sense?
Comment #2
pyrello commentedI got this working on the other site that I am currently working on.
I decided to go with something easier than FQL first, I just used the get_friends() function to pull a list of the current user's friends. It doesn't have any error checking, but an example of this working is at:
http://apps.facebook.com/ournewspaperarchive/fb/friend-search
In case anyone wants to know, here is the code that I used (again, no error handling is used yet, if you visit the page and you are not logged in, you will see an error):
Comment #3
lape commentedComment #4
joeysantiago commentedEhm... i'm trying to pull user pictures and show them in a block. in my custom module the
global $fbobject is NULL... could you please help me out?the branch i'm using is Branch: 6.x-3.x (version 3.x for Drupal 6.x)
thanks a lot
found out: the object is $_fb! :)