Muck Services

Muck Services adds functionality that aggregates, searches and analyzes data from many different web sources. This gem works in conjunction with the Muck Raker gem to handle aggregation, recommendations and search. It is recommended that you install both gems together.

Installation

Add muck services to your Gemfile:

gem 'muck-services'

After installing acts-as-taggable-on be sure to include the helper in application_helper.rb:

module ApplicationHelper
  include TagsHelper
end

Add routes Depending on which features you use from muck raker you may need to add additional routes to your application. For example, a user with include MuckServices::Models::MuckFeedParent and include MuckServices::Models::MuckFeedOwner the following routes would be required:

resources :users, :controller => 'muck/users' do
  # have to map into the muck/identity_feeds controller or rails can't find the identity_feeds
  resources :identity_feeds, :controller => 'muck/identity_feeds'
  resources :feeds, :controller => 'muck/feeds'
  resources :aggregations, :controller => 'muck/aggregations'
end

Usage

Muck raker aggregates data feeds and analyzes the results to make recommendations.

Gemfile

Add the following to your Gemfile:

gem "muck-feedbag", :require => "feedbag"
gem "feedzirra"
gem 'muck-engine'
gem 'muck-users'
gem 'muck-solr', :require => 'acts_as_solr' # if using solr
gem 'sunspot' # if using sunspot (recommended)

The following are optional but almost always used so you may as well pull them in.

gem 'muck-comments'
gem 'muck-activities'
gem 'muck-shares'
gem 'muck-raker'

Database

There are a number of rake tasks meant to help you get your database setup:

rake muck:services:db:bootstrap           # Loads some feeds oai endpoints to get things started
rake muck:services:db:bootstrap_services  # Deletes and reloads all services and service categories
rake muck:services:db:populate            # Flags the languages that the muck raker supports
rake muck:services:import_attention       # Imports attention data for use in testing

Bring in required files - migrations etc:

rake muck:services:sync                    # Sync files from muck services.

Identity Feeds

Specific feeds can be attached to objects. For example, a user might produce a blog or a flickr photo stream. The identity feed system associated the resulting data with the user so that recommendations can be improved.

Notes

muck-services uses muck-comments and muck-activities to add comments to entries in the ‘visits’ frame view. You can omit these gems if you don’t desire comments. muck-services also uses muck-shares and muck-activities to share entries with other users. Again you can omit these gems if you don’t desire the share capability.

To turn on this functionality create an initializer:

MuckServices.configure do |config|
  config.inform_admin_of_global_feed = true   # If true then the 'admin_email' will recieve an email anytime a global feed (one that is not 
                                              # attached to any object) is added.
  config.enable_services_comments = true      # Enables or disables comments in the frame that wraps content as a user browses recommendation results
  config.enable_services_shares = true        # Enables or disables sharing in the frame that wraps content as a user browses recommendation results
  config.show_google_search = true            # Determines whether or not a google search is displayed on the topic page
  config.load_feeds_on_server = false         # Determines whether feeds on a topic page are loaded on the server or the client.  Loading on the server can take a while
  config.combine_feeds_on_server = false      # Combines feeds loaded on the server
end

If you enable comments you will need a comment model with ‘include MuckServices::Models::MuckServicesComment’:

class Comment < ActiveRecord::Base
  include MuckComments::Models::MuckComment
  include MuckServices::Models::MuckServicesComment
end

CSS

Running rake muck:raker:sync will copy a default css file called muck-raker.css into your stylesheets directory.

You can include that file in your layout or copy it and modify it to meet your needs. (Don’t change the file as each time you run rake muck:raker:sync it will overwrite any changes you might have made.)

Frame css

There is an example css file for the framed page in frame.css.

Testing

You will need to have mysql setup to run the migrations for the test database. Muck raker has a few customizations which require mysql.

Copyright © 2009-2010 Tatemae.com, released under the MIT license