Create a gist now

Instantly share code, notes, and snippets.

Simple Ruby class to shorten URLs using TinyURL.
class Tinyurl
include HTTParty
base_uri 'tinyurl.com'
def shorten(url)
self.class.get("/api-create.php?url=#{url}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment