Code Monkey home page Code Monkey logo

feed_us_grabber's Introduction

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 ([email protected]) 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’

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

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

  1. Update environment.rb and include require ‘net/http’

  1. 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 => ‘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 => ‘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 rails_app/FeedUsGrabber

  • Clear a specific cache group

rails_app/FeedUsGrabber?cachecommand=clear&group=demo OR

rails_app/FeedUsGrabber?group=demo

  • Clear entire cache

rails_app/FeedUsGrabber?cachecommand=clearall

  • Clear cache in specific folder

rails_app/FeedUsGrabber?cachecommand=clear&folder=myFolder (can also optionally include group=demo to clear the cache group demo under the myFolder directory)

: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 => ‘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

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

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

feed_us_grabber's People

Contributors

cliffordru avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.