Hey,

This is probably really stupid question, sorry. I have searched this forum and hunted on the drupalforfacebook site, though.

I installed this module last week and am quite new to some of the facebook terminology. I started with a basic 'like' button - no problem. I am now interested to know whether I can pull in the News feed from our Facebook fan page on our Drupal website. Is this possible? Our fan page is publicly visible, is it necessary go through the whole API key step? (i am not the facebook user that 'owns' the fan page).

I am going to keep hunting around, if I figure anything out I will post it here.

Comments

Dave Cohen’s picture

You need to create an application, and the owner of that page needs to authorize the application. Including an extended permission to read the stream.

Look up stream api on facebook's doc.

AndyThornton’s picture

Hi Dave,

Cheers for the response.

I have used the "" tag and that has placed the content of our fan page wall on our site. It was very simple (when I found the tag!), and I did not need to authorize the application for this. I am not certain whether this will ultimately be too crude, though. I am still feeling my way to understanding the relative pros and cons of approaches.

Do I only get away with this because the fan page is public? If you or anyone else has any thoughts on the pros and cons I'd appreciate hearing them (as I imagine would anyone else who stumbles over this post).

Thanks again,
Andy

Dave Cohen’s picture

can't read what you posted. Try using <code>.

AndyThornton’s picture

sorry.

should have read:

I have used the "<fb:fan>" tag and that has placed the content of our fan page wall on our site. It was very simple (when I found the tag!), and I did not need to authorize the application for this. I am not certain whether this will ultimately be too crude, though. I am still feeling my way to understanding the relative pros and cons of approaches.

Do I only get away with this because the fan page is public? If you or anyone else has any thoughts on the pros and cons I'd appreciate hearing them (as I imagine would anyone else who stumbles over this post).

Dave Cohen’s picture

Facebook's documentation is so lame, I can't find anything about fb:fan on http://developers.facebook.com/docs/reference/fbml/

Please enlighten us.

AndyThornton’s picture

Hey Dave,

I guess I got lucky somehow, sorry I would have put more details but I always assumed I am behind the game on this stuff. I cannot quite remember the entire path that got me to finding that tag but here are a couple of pages that helped:

http://www.vbteam.info/vb-4-0-addons-and-template-modifications/49983-xfbml-facebook-like-box.html

Then from the console page:

http://developers.facebook.com/tools/console/

I clicked 'Examples' and found the fb:fan tag example code

Cheers,
Andy

hkirsman’s picture

Here's a module for this (D7):
http://drupal.org/sandbox/hkirsman/1786610
It creates block for fanbox. You can even theme it because fb:fan tag allows including css file!

At first fb_fan was stand-alone module but I figured out that I can use fb_app and fb_connect to do the connection part.

I need help on integrating fb_fan into fb as I know little about it.

Currently I would need discussion on config path and how the configuration should work:
1) Is the configuration path ok? Should it be under fb config path?
2) What about multiple fanboxes for different languages? Should config be in the block not on separate page? Maby list them under fb (admin/structure/fb) like apps but on different tab (this would need blocks to be created dynamically - possible?)?
3) Am I using fb, fb_app and fb_connect correctly? It all fell into place too easily. :)

Dave Cohen’s picture

1) Is the configuration path ok? Should it be under fb config path?

You mean the drupal menu path? You can use FB_PATH_ADMIN as a prefix. See how fb_menu() uses both FB_PATH_ADMIN and FB_PATH_ADMIN_ARGS. Or, use FB_PATH_ADMIN_APPS as a prefix for app-specific settings.
Possibly all your configuration could be in the block config? I.e. not even implement hook_menu()?

2) What about multiple fanboxes for different languages? Should config be in the block not on separate page? Maybe list them under fb (admin/structure/fb) like apps but on different tab (this would need blocks to be created dynamically - possible?)?

I don't exactly know the right approach for languages. I know it's possible to dynamically offer more blocks (i.e. fb_connect offers one block per app). However I suspect for languages each block should figure out language for the current user. I'm not expert on i18n.

You could certainly have a setting like, "How many blocks should this module provide?" Where an admin could increase the number if they have several fan_profile_id values.

3) Am I using fb, fb_app and fb_connect correctly? It all fell into place too easily. :)

It's certainly supposed to be easy. :)

I took a look at http://drupalcode.org/sandbox/hkirsman/1786610.git/tree/refs/heads/7.x-1.x, am I looking at the right thing? The code looks like you're not yet relying on modules/fb. For sure you should not be initializing the facebook javascript. Let modules/fb do that.

hkirsman’s picture

1) I'll try to implement it on FB_PATH_ADMIN . '/fb_fan then. All things in the same place!

2) I'm going to allow people to add n+1 fanboxes. These are then listed at the blocks page. Some websites can have multiple facebook pages, probably for different languages.

3) Yes, that's the right code. It's not initializing js. There's only one line of js and it's commented out.
//$content .= '<script type="text/javascript">FB.init("' . $api_key . '");</script>';
Did you mean something else?

hkirsman’s picture

https://github.com/hkirsman/fb_fan/tree/merge_with_fb (for D7)

Install instructions here: http://drupal.org/sandbox/hkirsman/1786610

I've done most of the important stuff and it works! :) Global settings are under admin/structure/fb/settings. Rest of the features are under List Fan Boxes and Add Fan Box tabs.

Somebody want to give it a try?

I still need to write README.txt and maby some other help. Depends how well people get it working.

hkirsman’s picture

Dave, I know you're very busy but I'll appreciate if you can at some point check out my FB Themeable Fan Box module. See comment #10

Thank you! :)