feed_us_grabber

ENVIRONEMNT

To be used with Rails 3.x and Ruby 1.9x. We’re proud of our software, and we want to tell you more about it. We also want to hear about what you do so we can help figure out whether Feed.Us is a good fit. Please call us (414-244-9900) or email us (contact@feed.us) or Skype us (feedussoftware) or visit us at feed.us

INSTALLATION

Follow these steps to download and install the feed_us_grabber gem:

  1. In your rails application, edit your Gemfile to include:

    gem 'feed_us_grabber'
    
  2. Run bundle install from the command line (this will download the feed_us_grabber to your environment)

  3. Open config/routes.rb and add following line:

    match "rails_app/FeedUsGrabber" => "FeedUsGrabber#index"        
    ** where rails_app is the root URL to your application.  The match is case sensitive.
  4. Update environment.rb and include require ‘net/http’

  5. Your installation is complete

USAGE

(1) Add following line to each controller (or app/controllers/application_controller.rb):

include FeedUsGrabberHelper

(2) Add following code inside your controllers actions:

@grabber = feedUsGrabber(:FeedUsURL => '<FEED.US URL>',:FeedUsCacheInterval => FEED_INTERVAL, :FeedUsCacheIntervalLength => FEED_INTERVAL_LENGTH, :FeedUsCacheGroup => 'FEED CACHE GROUP NAME')
        If you want to use FeedUsGrabber inside action index under controller "test" add following code inside action index of "test" controller
        * Example 1     
        def index
                @grabber = feedUsGrabber(:FeedUsURL => 'http://render.feed.us/Feed.aspx?g=00767d50-bde8-e111-9875-4040419a7f04',:FeedUsCacheInterval => CI_DAYS, :FeedUsCacheIntervalLength => 2, :FeedUsCacheGroup => 'demo')
        end
        * Example 2 The most basic configuration is (Note you will replace the URL listed with the URL of your content from "Export" on Feed.Us):
        def index
                @grabber = feedUsGrabber(:FeedUsURL => 'http://render.feed.us/Feed.aspx?g=00767d50-bde8-e111-9875-4040419a7f04')
        end

(3) Inside the view of the action add the following code to render your content

<%= feedUsGrabberRender @grabber %>
Example
index.erb of "test" looks like
<table>
        <tr>
                <td width='20%'>
                        <%= feedUsGrabberRender @grabber %>     
                </td>
                <td> Some text </td>
        </tr>
</table>

CLEARING CACHE

To clear cache goto following url

http://rails_app/FeedUsGrabber

:Note that if you receive a failure message that your IP is not authorized to clear the cache, add your IP to the ClientWhiteList in your controller (where xxx.xx.xx.xx is your IP) def index

@grabber = feedUsGrabber(:FeedUsURL => 'http://render.feed.us/Feed.aspx?g=00767d50-bde8-e111-9875-4040419a7f04', :ClientWhiteList => 'xxx.xx.xx.xx')

end

You can also specify multiple IP’s seperated with a comma :ClientWhiteList => ‘xxx.xx.xx.xx,yyy.yy.yy.yy’

LOCATION OF CACHE

Cache is maintained under RAILS_ROOT/tmp

LOCATION OF LOG

Log is maintained under RAILS_ROOT/log/FeedUsGrabber.log

Contributing to feed_us_grabber

Copyright © 2013 Feed.Us See LICENSE.txt for further details.