== google_url_shortner
Client Ruby pour accèder à l'API Google URL Shortener.
== Installation
gem install google_url_shortner
= Nouveautés :
-- Google::UrlShortner::Analytics --
Cette classe nous donne un accès complet aux analytics de Url Shortner :
- visiteurs
- plateformes
- navigateurs
- pays
-- Google::UrlShortner::Client --
Shorten et Expand pour encoder et décoder une adress.
Exemple :
-- Google::UrlShortner::Client.shorten( long_url ) --
-- Google::UrlShortner::Client.expand( short_url) --
== Utilisation
pre.
require "rubygems"
require "google_url_shortner"
Création d'un client connecté à l'API Google Url Shorten
client = Google::UrlShortner::Client.new
Shortening an url.
resp = client.shorten("http://www.gtug-dakar.org")
#Getting analytics.
analytics = client.get_analytics_for(resp.short_url)
analytics.visitors # => le nombre de visiteurs de l'url encodé
analytics.countries # => les pays depuis lesquels l'url a été visité
analytics.platforms # OS utilisés par les clients
analytics.browsers # Navigateurs/agents utilisés