The Facebook Stream module aims to provide an easily customisable block for displaying posts from a Facebook page. It uses Facebook's Graph API to retrieve posts from the timeline of a particular Facebook page, and then filters the returned posts based on the module's settings, before rendering the final block with a template file.
The current settings available to customise the stream are:
- The number of posts to display in the stream
- The types of posts to display in the stream
- Limiting posts to those created by the Facebook page itself
- The maximum number of requests to make to Facebook in order to retrieve the specified number of posts that meet your selection criteria
- The length of time to cache the stream data
The basic workflow for the module when the block is displayed is:
- The module returns a cached version of the stream if there is one available.
- If there is no cached stream, the module makes a request to Facebook for an access token using the Facebook application ID and secret from the module's settings.
- The module uses the returned access token to make a Graph API request for the feed of the Facebook page with the page ID from the module's settings.
- The module loops through the posts returned by Facebook, processing posts that meet post type and poster configurations and adding them to a list of posts to display. When the set number of posts to display has been reached, the stream is cached and sent to the theme template for rendering.
- If the module finishes processing the posts returned by Facebook without reaching the number of posts to display, then it makes another request to Facebook for more posts, and continues to process the new posts.
- The module will continue to make new requests to Facebook until it either reaches the set number of posts to display, or it reaches the maximum number of requests to make to Facebook. The maximum number of requests defaults to 1, so by default the module will only make 2 requests to Facebook: one for the access token, and one for the posts.
Similar Modules:
Facebook Pull also provides a block to display Facebook posts, but it does not provide options for filtering the posts that are displayed. Also, while Facebook Pull has a limit for the number of posts to display, Facebook Stream can be configured to make multiple requests in order to display the number of posts set on the settings page.
My Background:
I have had a part time job developing Drupal websites for almost 2 years, including working on modules and themes.
Links:
Project page: http://drupal.org/sandbox/ben.denham/1959688
Git repository: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ben.denham/1959688.git facebook_stream
Comments
Comment #1
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
dimitrov.adrian commentedTry using drupal_http_request() instead of file_get_contents().
Comment #3
ben.denham commentedThanks dimitrov.adrian!
I've updated fb_stream_make_request() to use drupal_http_request() instead of file_get_contents().
Kind regards,
Ben
Comment #4
jongagne commentedRecommendations:
If possible provide some kind of error message similar to "Please enter a valid Facebook page ID".
Suggested Future Improvements:
The sentence left a lot of room for misinterpretation (i.e it will only allow posts published on the Facebook page appear on the screen?). It was my understanding that was the purpose of the module unless you are able to use multiple Facebook page ID's in the same block at a time.
Comment #5
ben.denham commentedHi jongagne, thanks for all of the feedback!
Here is what I've done to address those issues:
Thanks again for the review!
Kind regards,
Ben
Comment #6
afi_amouzou commentedI installed the module and fill the form but I get this error: Fatal error: Call to undefined function element_validate_nonnegative_number() in fb_stream.admin.inc on line 112
You are calling this function but it is not defined.
Comment #7
ben.denham commentedHi afi_amouzou, thanks for pointing that out.
I had added a new field to the configuration form and had misspelt the validation function name.
This issue has now been resolved.
Thanks again,
Ben
Comment #8
kscheirerCode looks good. Consider detailing the difference with Facebook Pull more clearly than what's on the current project page. The original post here is more informative:
The code looks good.
----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #9
ben.denham commentedThank you very much for the review kscheirer.
I have replaced the original "Similar Modules" section on the project page and readme.txt with the more detailed paragraph from this thread as you suggested.
Thanks again,
Ben
Comment #10
abhijeetkalsi commentedHi ben.denham
Good efforts. But have one question that one of my module named 'Facebook Wall' is already exists providing the FB wall posts with better theming & user comments.
Is your module do anything new to it ?
Comment #11
kscheirerBased on #10, need more information about that.
Comment #12
ben.denham commentedHi there AbhijeetKalsi,
After examining your module, I would say that the features that distinguish my module from yours are:
I was initially confused as to why I didn't see your module when I was searching for similar modules before making this post, and then I realised that your module was posted on April 19, while mine was posted on April 3.
Kind regards,
Ben
Comment #13
abhijeetkalsi commentedHi Ben denham,
1) I had developed my module in month of march but it take time to test & review its working, Thats why I deploy in april.
2) Since Access token it provided by facebook expires in one hour and I had convert that token in 60 day which is very necessary and not applied in your module.
3) Also, i had not fixed the no of wall post limit. There is a Get Older post button on wall post page that display the next older post.
I am not against you module. It my advice to add some extra features that helps your module to contribute.
Comment #14
kscheirerIf the differences between these modules are not too fundamental for patching the existing one, we would love to see you joining forces and concentrate all power on enhancing one module.
Comment #15
kscheirerPlease set back to "needs review" if you are unable to work together for any reason or feel that the modules are significantly different.
Comment #16
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.