-
Notifications
You must be signed in to change notification settings - Fork 0
Shorten URLs with any service
lassebunk/shortie
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
== About Shortie Shortie makes it easy to shorten URLs with any service directly from your Ruby applications. == Installing Shortie $ sudo gem install shortie == Using Shortie Require Shortie: require 'rubygems' require 'shortie' In your Ruby code, to shorten a URL: Service.find_by_key("bitly").shorten("http://github.com") To get a list of all services: Service.all.each { |s| puts s.key + ": " + s.name} == How to make your own shortener Take a look at the shorteners in lib/shortie/shorteners to see how a shortener is made. Basically it's just doing it like this: module Shortie module Shorteners class Bitly < BaseShortener def shorten # communicating with bit.ly. return url end end Service.register("bitly", "bit.ly", Bitly) end end After creating a new shortener please send me a pull request and I'll implement your shortener as soon as possible. == Using Shortie on other platforms than Ruby You can use Shortie as a service at http://shortservice.lassebunk.dk. Take a look at http://shortservice.lassebunk.dk/api for info on how to use the API.
About
Shorten URLs with any service
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published