lib/shorty/trim.rb
# The trim_url API method as defined: http://tr.im/website/api#trim_url
# The following options can be passed:
#
# - url: the URL you want to shorten
# - custom: A custom URL that is preferred to an auto-generated URL.
# - searchtags: A search string value to attach to a tr.im URL.
# - privacycode: A string value that must be appended after the URL.
# - newtrim: If present with any value, it will force the creation of a new tr.im URL.
# - sandbox: If present with any value a test data set will be returned, and no URL created. This is intended for testing so that you do not consume API calls or insert pointless data while in development.
#
#   require 'shorty'
#   api = Shorty::Trim.new
#   api.trim_url(:url => 'http://google.com', :custom => 'thisismygoogle', :sandbox => 'true') # => http://tr.im/szMj


the URL you want to shorten
custom: A custom URL that is preferred to an auto-generated URL.
searchtags: A search string value to attach to a tr.im URL.
privacycode: A string value that must be appended after the URL.
newtrim: If present with any value, it will force the creation of a new tr.im URL.
sandbox: If present with any value a test data set will be returned, and no URL created. This is intended for testing so that you do not consume API calls or insert pointless data while in development.


the URL you want to shorten custom : A custom URL that is preferred to an auto - generated URL . searchtags : A search string value to attach to a tr . im URL . privacycode : A string value that must be appended after the URL . newtrim : If present with any value it will force the creation of a new tr . im URL . sandbox : If present with any value a test data set will be returned and no URL created . This is intended for testing so that you do not consume API calls or insert pointless data while in development .
def trim_url( options = {} )
      options.merge!(@options)
      response = self.class.get( '/trim_url.xml', :query => options )
      response = handle_response(Crack::XML.parse(response))
      return response.url
    end
def trim_url ( options = { } ) options . merge! ( @options ) response = self . class . get ( '/trim_url.xml' , :query => options ) response = handle_response ( Crack :: XML . parse ( response ) ) return response . url end
The trim_url API method as defined: http://tr.im/website/api#trim_url
The following options can be passed:
The trim_url API method as defined : http : // tr . im / website / api#trim_url The following options can be passed :
options