Skip to content

Instantly share code, notes, and snippets.

@rbazinet rbazinet/tinyurl.rb
Created Jun 6, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.