API Documentation
Smallr has it's own API, which can be called from your own application. Please see the code below for an example (and very simple) consumer:
require 'rubygems'
require 'action_web_service'
if ARGV.length < 1
puts "Usage : #{$0} url_to_shorten"
exit
end
class UrlApi < ActionWebService::API::Base
api_method :shorten, :expects => [ { :long_url => :string } ], :returns => [ :string ]
end
url = ActionWebService::Client::Soap.new( UrlApi, "http://smallr.com/url/api" )
puts url.shorten( ARGV[0] )
So, what does it do?
If you can't tell what it is yet, the above script, when ran, will go off to smallr.com, shorten your URL and print the path you ought to stick at the end of http://smallr.com/ on stdout.
As you can see, shorten is the only method exposed by the API, so the above code should pretty much cover all bases with the usage of it.
