Skip to content

Instantly share code, notes, and snippets.

View google urlshortner with ruby
require "net/http"
require "net/https"
require "rubygems"
require "json"
HOST="www.googleapis.com"
PORT=443
API_URL="/urlshortener/v1/url?key=YOUR-API key"
def shorten_url long_url
You can’t perform that action at this time.