I <3 Quotes Client
(Working on Ruby 1.9.X - Let me know if you need the 1.8.X version)
Roberto Decurnex (email@example.com)
If you are using Bundler you can easily add the following line to your Gemfile:
Or you can just install it as a ruby gem by running:
$ gem install i_heart_quotes
You can also clone the project with Git by running: $ git clone git://github.com/robertodecurnex/rack-jsonp-middlewarei
Getting a random quote
require 'i_heart_quotes' fortune = ::. fortune.quote #=> "One's never alone with a rubber duck." fortune.source #=> "hitchhiker" fortune. #=> ["hitchhiker"] fortune. #=> "http://iheartquotes.com/fortune/show/7934"
require 'i_heart_quotes' # Returns a quote from the hitchhiker that has a single line. ::.(:source => "hitchhiker", :max_lines => 1). # Returns a quote from the either hitchhiker or cryptonomicon that has at most 2 lines. # Note that you can chain as many where s as you want. ::.(:source => "hitchhiker+cryptonomicon").(:max_lines => 2).
- :source ("+" separated list of desired sources. Available sources at http://iheartquotes.com/api)
- :max_lines (maximum number of lines in the quote)
- :min_lines (minumum number of lines in the quote)
- :max_characters (maximum number of characters in the quote)
- :min_characters (minimum number of characters in the quote)