lib/shorty/bitly.rb
# shorten, pass:
#
# - longurl: the URL to be shortened
shorten, pass:
longurl: the URL to be shortened
shorten pass : longurl : the URL to be shortened
def shorten( longurl )
      query = {:longUrl => longurl}
      query.merge!(@options)
      short = Crack::JSON.parse(self.class.get('/shorten', :query => query))
      short["errorCode"].zero? ? short["results"][longurl]["shortUrl"] : raise_error(short)
    end
def shorten ( longurl ) query = { :longUrl => longurl } query . merge! ( @options ) short = Crack :: JSON . parse ( self . class . get ( '/shorten' , :query => query ) ) short [ "errorCode" ] . zero? ? short [ "results" ] [ longurl ] [ "shortUrl" ] : raise_error ( short ) end
shorten, pass:
 longurl: the URL to be shortened
shorten pass : longurl : the URL to be shortened
longurl