A Module for Easifying Facebook App Development

Events happening in the community are now at Drupal community events on www.drupal.org.
James Andres-gdo's picture

Hello Facebook Developers,

To speed the development of a Facebook App we've been working on our team has developed a Facebook "Development Framework" (I use the term very loosely) for Drupal. We're guessing this module would be useful for some Drupal developers, so we've been trying to keep it general.

Before we go any further it would be very helpful to get some feedback from the community. Here's a few questions we've got...

  • Does this sort of a module interest you?
  • Is writing a Facebook Application using Drupal as a back-end something that interests you?
  • If yes, what sort of features would you like (please compare with the list below)?

The current features we have going include:

  • GUI Interface for hooking your callback URL, post-add and post-remove URL, etc.
  • Automatic menu handling (http://apps.facebook.com/YOUR_APP style URLs get smoothly translated into Drupal)
  • Drupal + Facebook Pager integration (themed in Facebook style!)
  • Facebook -> Drupal automatic account creation, on install (experimental)
  • Session handling, for keeping form state (experimental)

Questions, comments or thoughts?

James Andres

Comments

One idea...

Gekigangaa@drupal.org's picture

Hey James,

How about the idea of having a hook function similar to how hook_node_api works which captures different types of facebook operations. Things like installation or deletion of your app, or postings to different areas in fb like requests and mini-feeds. Thoughts?

Greg Field

Great idea!

James Andres-gdo's picture

Install and uninstall seem like perfect candidates for a hook_facebook(), or whatever it might be called. I'm not sure what sort of notifications we can respond to, but the idea sounds cool.

I'd, personally, also like to see a really transparent handling of page requests. The current facebook_apps.module just calls one internal callback--ie: my_facebook_app()--and the programmer is expected to handle the requests from there. It feels a little Drupal 4.6 to me :-P

James.

facebook api as translator

amanuel's picture

James,

In cases of non iframe, it would be nice to have standard handlers to the various expected urls such as the sidenav, help, edit, and privacy urls.

I'd would also like to keep out as much of the FBML out of the apps for the simple reason that I'd like my modules to work with and without facebook realms.

For example, fb:narrow and fb:wide could be wrap the teaser for example.

Authentication. Groan. painful. the api needs to sort this out....how? haven't thought enough about it. I have looked at facebook_auth, easy registration, and webserver_auth.

I guess what it boils down to is having a module that acts as a translator to make drupal modules run in facebook....like a filter of sorts.

We should also look at getting early bootstrapping to cover the quick short calls...as facebook may overwhelm the site and a 12sec delay=death (figuratively and user experientially).

Cheers.

Logged ..

James Andres-gdo's picture

Hello Amanuel,

Thanks for the feedback. I think you've hit on some good points there:

In cases of non iframe, it would be nice to have standard handlers to the various expected urls such as the sidenav, help, edit, and privacy urls.

Completely agree, I think this further goes to show we need tight integration with the drupal menu system. Ideally we wouldn't have to provide special URLSs since the system would do that nearly automatically (ie: just add a menu item).

I'd would also like to keep out as much of the FBML out of the apps for the simple reason that I'd like my modules to work with and without facebook realms.

Yes, keeping in step with Drupal's existing theming layers is critical. An idea, for our project we use a special translation table that translates tags like .... style="@beveled_gray" into inline CSS (because FB doesn't let you attach your own style to FBML pages, you have to inline EVERYTHING .. ugh). Would something like this interest anyone?

Authentication. Groan. painful. the api needs to sort this out....how? haven't thought enough about it. I have looked at facebook_auth, easy registration, and webserver_auth.

Yes, we've got this solved a few times over (Rob built some code for chipin.com that solves this quite well, I've also built my own). Hopefully this will get to a releasable state soon.

We should also look at getting early bootstrapping to cover the quick short calls...as facebook may overwhelm the site and a 12sec delay=death (figuratively and user experientially).

That's interesting, I hadn't thought of using that approach for this. It might be useful .. hmmm..

Cheers,

  • James

Dealing with Facebook's Limits

Gekigangaa@drupal.org's picture

Facebook has different limitations which it places. Things like each user only being able to post 10 items on a friend's minifeed within a 12 hour period. Perhaps and idea would be a way of keeping track of these limitations and providing an easy interface for dealing with the situations this leads to.

Keeping Track of Pending Requests

Gekigangaa@drupal.org's picture

I've been looking through the notifications and it's possible to see a lot of the pending notifications a user has. However, it's not possible to see any pending requests except for pending friend requests. I was thinking it would be great if there was a way to keep track of any pending requests we send out.

Authentication

geohelper's picture

My website (using Drupal) and Facebook app (hand-coded PHP) are already up and running, but I forked myself by using two different databases. Now, I'm looking to consolidate everything because the Facebook users are contributing more content than the Drupal users (and I miss Drupal).

The most critical part for me is user authentication. Ideally, a user could authenticate using either Facebook or Drupal. However, within the Facebook app, a user should never be asked to provide a Drupal-based user/pass! That is a bad experience and will turn off most of the FB users.

Side note, it may be helpful to look at how OpenID is implemented in Drupal 6 because extending the auth in a generic way seems to be useful in the near future (MySpace API?). After a user is authenticated, everything else should work the same.

Beyond that, I think urls, feeding, profile writing, and managing fb:refs are in the "nice to have" category.

Action Sports - Where Do You Ride?
http://www.facebook.com/apps/application.php?id=2331959216

just for the record, the

halkeye's picture

just for the record, the current facebook_auth module only asks you for your email after a facebook login. There is no need, and actually against the TOS to ever ask a user for their facebook password.

Huh?

amanuel's picture

facebook auth takes you to the edit page to add your email address. The password is not used in drupal as the authentication is done via facebook.

Auth Paths

geohelper's picture

Here is the current path...

  1. Arrive at the www site and presented with both user/pass and Facebook link [click FB]
  2. Redirected to Facebook-based login [provide email/pass & click log in]
  3. Redirected to FB-based Terms of Service [click log in - ideally, would optionally require install here]
  4. Redirected back to www site at the user edit screen.

Is there a way to just send the user back to the home pages instead of the user edit page?
It is not needed since the user is already authenticated and will be the 3rd acceptance-type screen. No matter the reasons, it is a crappy experience for the user. They should be kicked back to the home page, which would have the "my account" link if they care to provide the email/pass. The user has already invested time building a FB profile and is probably on your web site to see the content, not build another profile.

What about the Facebook-based canvas pages?
When a FB user goes to your apps.facebook.com/drupal-app page, we need a way to control whether it is required for them to add the app, and if so, write their FB session key to the database. This allows us to write profiles and feed asynchronously.

Note: The user should never be presented with a Drupal-based user/pass when they are in the canvas-based app. Ideally, the path would be...

  1. Find app in Facebook
  2. Accept (more often add) application
  3. Arrive at canvas-based app (already authenticated and ready to add nodes!)

Please let me know where help is needed. I'm very vested in the Drupal-FB integration.

a) facebook_auth wasn't

halkeye's picture

a) facebook_auth wasn't designed for canvas pages in mind.
b) I only redirected to the edit account page because you cannot get an email from facebook and drupal prefers having an email address set. If they click on anything else they are still created. One thing to note though, You are not supposed to store any of the information retrieved from facebook in regards to a profile. Its actually explicit in their TOS.

Built already, but not in a releasable state

James Andres-gdo's picture

Hello,

As Gavin mentioned the facebook_auth module wasn't built with the "facebook app platform" in mind. It's purpose is to let you log into a Drupal installation with your FB credentials.

I believe what is being asked for is a module that does the inverse of the facebook_auth module. A module that lets you automatically authenticate with your Drupal site when somebody installs your Facebook Application. Or better yet, automatically create a Drupal account when the FB user installs your App (this is against the TOS in some cases though).

In either case, both of these features have been written. I've got an "extremely hacked" version written for my own purposes, and Rob has written a much slicker version for chipin.com.

Unfortunately I'm not in a position to polish up either of them right now. Hopefully within 2 or so weeks (ie: when my deadline is passed) I'll have some time to get this together.

If anyone is interested in helping out, I'm completely not opposed :-)

Thanks,

James.

Canvas App

geohelper's picture

I don't see too much benefit in allowing Facebook users to authenticate on a Drupal web site. Sure it cuts out the registration step, but it offers very little added value to the Facebook user.

With all the Facebook hype, I'm a little surprised that it has been so difficult to find others who want a Drupal-powered FB app (canvas pages, profile modules and feeding).

A start

RobRoy's picture

I started a facebook_app project just in CVS for now... http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/facebook_app/

I was in the middle of refactoring the code we used for the ChipIn FB app and wanted to get it in CVS. Still a bunch to do, but the solid roots are there. I'm offline for a few days, but let's get this puppy rolling.

Patches go to http://drupal.org/project/facebook_app.

twentyfive8's picture

I've posted this numerous times, but have yet to get an answer! Please!


I KNOW this has been asked in here (see the two threads below), but have yet to get an answer to this problem ....

I've installed both the Facebook and Facebook_auth modules on my website http://nova.meetuon.com , and have followed the instructions, both from the README and from these threads :

http://drupal.org/node/158088
http://drupal.org/node/158481 ...

as in, I not only installed the module, but I put the unzipped Facebook library (that you get from the site) in the Facebook_auth directory.

However, I get this error message right off the bat:warning: main(simplexml44-0_4_4/class/IsterXmlSimpleXMLImpl.php) [function.main]: failed to open stream: No such file or directory in /home/meetuonc/public_html/nova/modules/facebook_auth/facebook-platform/php4client/facebookapi_php4_restlib.php on line 34.

What, exactly, is going on here? Again, I`ve done everything I was told to do, and yet this pops up!

Please e-mail me!

facebook module is pretty

halkeye's picture

facebook module is pretty close to abandoned
faceboook_auth's readme file gives extra instructions if you install on php4, which is to extract the simplexml folder into your facebook-platform directory.

If you have php4.
3) As per facebook instructions..
3a) Get http://downloads.sourceforge.net/ister4framework/simplexml44-0_4_4.tar.gz
3b) Extract to facebook-platform/php4client

Profile problem after install

jindustry's picture

After installing these facebook-related modules, I find that I can not access or edit the profiles of members of the site. Even the administrator gets this message "You are not authorized to access this page." when trying to access a page like http://your.drupal.path/user/4. Is there an easy way to change this so the admin and other roles can view and edit profiles?

This may already be possible

cybermache's picture

This may already be possible but thought I'd chime in.

Recently my company started looking into the option of doing surveys and contest signups in facebook. We are already using Webform on our public site and thought that it would be smoother if FB users didn't have to go off FB to fill in a survey. It's already hard enough to get people to fill surveys out, making it instantaneous would help increase those numbers. Connecting FB's calendar with Drupal's calendar would also prove helpful especially if Signup could come along with those events and allow page fans to signup through FB. Not sure if FB has rules against sales, but having a bridge with UberCart would be phenomenal.

RE:Facebook App Development

mobileprogramming's picture

I think it would be great if Drupal had a "Share on " feature like Facebook's share.php. Many sites have a "Share on Facebook" button, but there is also a link you can bookmark so you can share any page you visit on the web.

Drupal's aggregator module already has the ability to blog any individual news item that you subscribe to on your Drupal site by clicking "Blog It". But how would a similar button work that you can use on external sites, and also bookmark in your browser?

Mobile Appications development
www.mobileprogramming.com

Facebook API

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: