No commit activity in last 3 years
No release in over 3 years
Goo.gl Url Shotener implemented by Google API. Initialize Shortener with API key to avoid reaching request limits accessed by anonymous request.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
~> 2.11

Runtime

 Project Readme

GoogleAPIUrlShortener

Gem Version Build Status

Goo.gl Url Shotener implemented by Google API. Initialize Shortener with API key to avoid reaching request limits accessed by anonymous request.

Installation

Add this line to your application's Gemfile:

gem 'google_api_url_shortener'

And then execute:

$ bundle

Or install it yourself as:

$ gem install google_api_url_shortener

Usage

First, register a Google project and get API key with urlshortener API.

google_shortener = GoogleAPIUrlShortener.new(GOOGLE_API_KEY)
google_shortener.shorten("https://github.com/hrs113355/google_api_url_shortener")

=> "https://goo.gl/LJbyHv"

google_shortener.expand("https://goo.gl/LJbyHv") # protocol is required

=> "https://github.com/hrs113355/google_api_url_shortener"

Changes

  • 1.0.1 - first implementation
  • 1.0.2 - add shorted url expand function