HomePage

A Ruby API for the http://bit.ly URL-shortening service

require 'rubygems' require 'bitly4r'
access_token = ENV['TOKEN'] long_url = 'http://rubyforge.org/'
client = Bitly4R::Client.new(:token => access_token)
# shorten short_url = client.shorten(long_url).to_s puts "short_url = #{short_url}"
# re-expand raise 'aww, cmon!' unless (long_url == client.expand(short_url).to_s)

  • Source @ GitHub
  • Documentation
  • Questions?
Check our About page
Edit - History - Print - Recent Changes - Search
Page last modified on May 01, 2023, at 01:55 AM