Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
i_heart_quotes.gemspec has been down for quite a long time now 😢


Travis Status - Dependecies Status - Code Climate

I <3 Quotes Client


This is a ruby client to interact with the I <3 Quotes API.

(Working on Ruby 1.9.X - Let me know if you need the 1.8.X version)

Full Documentation


Roberto Decurnex (


If you are using Bundler you can easily add the following line to your Gemfile:

gem 'i_heart_quotes'

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://

Usage Example

Getting a random quote

require 'i_heart_quotes'

fortune  = IHeartQuotes::Client.random

fortune.quote #=> "One's never alone with a rubber duck."

fortune.source #=> "hitchhiker"

fortune.tags #=> ["hitchhiker"] #=> ""

Using filters

require 'i_heart_quotes'

# Returns a quote from the hitchhiker that has a single line.
IHeartQuotes::Client.where(:source => "hitchhiker", :max_lines => 1).random

# 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.
IHeartQuotes::Client.where(:source => "hitchhiker+cryptonomicon").where(:max_lines => 2).random

Supported Filters

  • :source ("+" separated list of desired sources. Available sources at
  • :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)