Outbrain is a content recommendation engine, in a SaaS model, which is focused on blogs and content websites. Major newspapers are using Outbrain to bring an Amazon-like "People who bought this, also looked at that" links. This mechanism is quite hard to achieve alone, even with the great tools of the almighty Drupal.

This module allows you to take advantage of Outbrain's excellent service, and recommend content to users, based on various axis. Experience teaches that for recommendations on content within the same website, the service is completely free. However, the module requires an active account at outbrain.com.

You have control over which content types are to be recommended, and using a supplied block, you can choose where recommendations are being displayed.

It should be noted that Outbrain first studies your users, and so it may take hours until you see the first results.

** Development of the module was sponsored by Linnovate.

Installation

[Please note: your site must be visible to the outside world (or at least Outbrain's servers) in order to get validated.]

  • Download and enable the module.
  • Register or login at outbrain.com.
  • Go to 'Manage Blogs' > 'Add Blog' > Choose the Drupal logo > Enter your site's URL > Check the tiny terms box > Click 'Continue'.
  • Go to yoursite.com/admin/config/outbrain and copy your newly generated Outbrain key to the matching field.
  • Choose relevant node types.
  • Click 'Save configuration'.
  • After the page has been reloaded click the 'Send' button near the Outbrain key.
  • Go to Outbrain's 'Manage Blogs' page and click 'Check Now!' near your site's address.
  • When your site is validated, in Outbrain 'Manage Blogs' page go to the site's 'settings' and adjust your settings as you see fit.
  • You should start see Outbrain's recommendations in your site. If you don't see recommendations try to generate some activity (like clicking internal nodes links) for Outbrain to start collecting statistics.

Project Page:

http://drupal.org/sandbox/eyalev/1688154

Git repository

git clone --recursive --branch 7.x-1.x eyalev@git.drupal.org:sandbox/eyalev/1688154.git outbrain

Drupal Version

Drupal 7

Comments

parwan005’s picture

Status: Needs review » Needs work

Hi,

I found few issues in your module while doing manual review
1) Please remove your commented code from the files. This should never be done.
2) You also haven't followed indentation at various places. Make sure each of your code line is follows indentation as per standards. You can refer this for above.
3) Make sure each of your file ends with an new line.
4) You can remove $Id$ as its no longer necessary.
5) You have used js onload function in your js file. I would suggest jquery's document.ready function.
6) Also README.txt is too small with content. Make sure to write and guide how the module works. Also project description is also not enough.

Also make sure to fix your report issues here http://ventral.org/pareview/httpgitdrupalorgsandboxeyalev1688154git

eyalev’s picture

Status: Needs work » Needs review

Hi,
Thank you very much for the review.
I updated the module and will appreciate another review.
Thanks,
Eyal

eyalev’s picture

Issue summary: View changes

Installation instructions.

eyalev’s picture

Regarding issue no. 5 about onload - for some reason document.ready didn't work well so I stayed with onload.

Eyal

eyalev’s picture

Issue summary: View changes

Description update.

joelrosen’s picture

Status: Needs review » Needs work

Hi,

I installed your module but don't see any links pointing to your configuration page. You might want to add a link somewhere. You could add a configure line to your module's .info file, or do what's needed to get your menu item to show up on the config page (http://drupal.stackexchange.com/questions/1757/how-to-add-module-to-admi... might help), or both.

Here are another few issues I'm seeing on a quick readthrough of the code:

  1. Line 49 - #description should be wrapped in t() I think
  2. In your config form, you check for the outbrain_node_types variable, and default to 'blog', but in outbrain_node_view you do the same check but default to 'article'. Should these be consistent?
  3. I'm not sure what the purpose of all this logic here is:
      // Get recommendation mode and rater mode.
      $outbrain_rec_mode   = variable_get("outbrain_rec_mode", NULL);
      $outbrain_rater_mode = variable_get("outbrain_rater_mode", NULL);
      if (empty($outbrain_rec_mode) || empty($outbrain_rater_mode)) {
        $outbrain_rater_mode = 'none';
        $outbrain_rec_mode = 'strip';
        variable_set('outbrain_rec_mode', $outbrain_rec_mode);
        variable_set('outbrain_rater_mode', $outbrain_rater_mode);
      }
    

    It doesn't seem like there's anywhere that these variables could be set to anything other than the defaults, so why use variables?

  4.   if (!isset($installation_time_string) || (isset($installation_time_string) &&  empty($installation_time_string))) {
    

    I think this can be simplified to:

      if (empty($installation_time_string)) {
    
  5.   $count_options = array(
        1 => '1',
        2 => '2',
        3 => '3',
        4 => '4',
        5 => '5',
        6 => '6',
        7 => '7',
        8 => '8',
        9 => '9',
        10 => '10',
      );
    

    This can be simplified to:

       $count_options = drupal_map_assoc(range(1, 10));
    
  6. In the same block of code, you've defined $size_options = array(); but then don't use this variable anywhere else.
  7. The module ends with a comment block about implementing hook_block, but the following code is just sitting out in the open, not implementing a hook. I'm guessing this is something you want to run on every page load, but even so, isn't there a hook it should go into?
  8. For your javascript, you might want to take a read through http://drupal.org/node/756722. I think your javascript is more likely to play better with other modules if you use Drupal.behaviors, and try encapsulating your code a little more. I'm also not sure if there was a good reason to avoid using jQuery, which is built-in to Drupal, but I think there's no reason to reinvent the wheel. Why define outbrain_$() when you can do this?
    (function ($) {
      // All your code here
    })(jQuery);
    

Overall I think the code could still use a bit tightening up, especially since it looks like there's remnants sitting around that you maybe forgot to delete. And I'm not an expert but I think there are definitely some more Drupal ways to implement your javascript, and considering this module is mostly javascript, it might be worth taking the time to read up on.

Miszel’s picture

Outbrain integration module developed by jarrodirwin for Dennis Publishing is now contributed to the community and available here: http://drupal.org/project/outbrain

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing 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.

rgylion’s picture

Hi,

On the Outbrain script below:

(function(){window.OB_platformType=8;window.OB_langJS="http://widgets.outbrain.com/lang_en.js";window.OBITm="1370639749351";window.OB_recMode="brn_strip";var ob=document.createElement("script");ob.type="text/javascript";ob.async=true;ob.src="http"+("https:"===document.location.protocol?"s":"")+"://widgets.outbrain.com/outbrainLT.js";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(ob,h);})();

What to replace in DROP_PERMALINK_HERE?

Help is very much appreciated. I am integrating it in drupal 7 site.

Thanks,
Rene

rgylion’s picture

Here is the code...

<div data-src="DROP_PERMALINK_HERE" class="OUTBRAIN" ></div>
<script type="text/javascript">(function(){window.OB_platformType=8;window.OB_langJS="http://widgets.outbrain.com/lang_en.js";window.OBITm="1370639749351";window.OB_recMode="brn_strip";var ob=document.createElement("script");ob.type="text/javascript";ob.async=true;ob.src="http"+("https:"===document.location.protocol?"s":"")+"://widgets.outbrain.com/outbrainLT.js";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(ob,h);})();</script>

hyperglide’s picture

Perhaps best to post the issue within the project page issue queue. -- > http://drupal.org/project/outbrain

hyperglide’s picture

Issue summary: View changes

Update