Skip to content

Instantly share code, notes, and snippets.

@zackfern
Created February 3, 2012 05:19
Show Gist options
  • Save zackfern/1728279 to your computer and use it in GitHub Desktop.
Save zackfern/1728279 to your computer and use it in GitHub Desktop.
Garrett's Witty Tagline Helper
def witty_tagline
uri = URI.parse("http://www.iheartquotes.com/api/v1/random?source=oneliners&format=text")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = false
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
raw CGI::unescape(response.body).split("[")[0]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment