Skip to content

richardsondx/recommendable

 
 

Repository files navigation

Recommendable Build Status

Recommendable is an engine for Rails 3 applications to quickly add the ability for your users to Like/Dislike items and receive recommendations for new items. It uses Redis to store your recommendations and keep them sorted by how good the recommendation is.

Installation

Add the following to your Rails application's Gemfile:

  gem "recommendable", :git => "git://github.com/davidcelis/recommendable"

After bundling, run the installation generator:

$ rails g recommendable:install

Double check config/initializers/recommendable.rb for options on configuring your Redis connection. After a user likes or dislikes something new, they are placed in a Resque queue to have their recommendation updated. Start up resque like so:

$ QUEUE=recommendable rake environment resque:work

You can run this command multiple times if you wish to start more than one worker. For more options on this task, head over to defunkt/resque.

Usage

In your Rails model that will be receiving recommendations:

class User < ActiveRecord::Base
  recommends :movies, :shows, :other_things
  
  # ...
end

That's it! Please note, however, that you may only do this in one model at this time.

For more details on how to use Recommendable once it's installed and configured, check out the more detailed README or see the documentation.

Installing Redis

Recommendable requires Redis to deliver recommendations. The collaborative filtering logic is based almost entirely on set math, and Redis is blazing fast for this. NOTE: Your redis database MUST be persistent.

Homebrew

For Mac OS X users, homebrew is by far the easiest way to install Redis.

$ brew install redis

Via Resque

Resque (which is also a dependency of recommendable) includes Rake tasks that will install and run Redis for you:

$ git clone git://github.com/defunkt/resque.git
$ cd resque
$ rake redis:install dtach:install
$ rake redis:start

Redis will now be running on localhost:6379. After a second, you can hit ctrl-\ to detach and keep Redis running in the background.

Contributing to recommendable

Once you've made your great commits:

  1. Fork recommendable
  2. Create a feature branch
  3. Write your code (and tests please)
  4. Push to your branch's origin
  5. Create a Pull Request from your branch
  6. That's it!

Links

Copyright

Copyright © 2012 David Celis. See LICENSE.txt for further details.

About

A recommendation engine for Likes and Dislikes in Rails 3. Uses Redis.

Resources

License

Stars

Watchers

Forks

Packages

No packages published