Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

googl-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

googl-api

  • 0.3.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= googl-api

A very simple Ruby wrapper for the Google Url Shortener.

  • service - http://goo.gl
  • api docs - http://code.google.com/apis/urlshortener/index.html

== INSTALLATION:

gem install googl-api

== USAGE:

Create a googl client using your API key and/or with ClientLogin auth information. (note: you will need to "Activate" the "URL Shortener API" on this page to retrieve and user your api_key: https://code.google.com/apis/console/b/0/#project:1090911256926:overview )

googl = GooglApi.new(:api_key => 'your_api_key', :email => 'google_email', :password => 'valid_password')

Then use the client to shorten, extend or review the analytics for a URL. If authentication is provided the short_url provided will be specific to the given user and will show up in the users history.

googl.shorten('http://www.google.com') googl.expand('http://goo.gl/fbsS') googl.analytics('http://goo.gl/fbsS') or googl.analytics('http://goo.gl/fbsS', 'FULL')

These methods will return a response object containing the short/long url and other values provide by the API

To access a users history you must provide authentication information

googl = GooglApi.new(:email => 'google_email', :password => 'valid_password') googl.history

This method returns a hash containing the authenticated users history

  • TODO: implement analytics and history response objects
  • TODO: implement oauth

== ACKNOWLEDGEMENTS

Code heavily inspired/influenced by philnash's bitly gem https://github.com/philnash/bitly

== Contributing to googl-api

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

== Copyright

Copyright (c) 2011 John Allen. See LICENSE.txt for further details.

FAQs

Package last updated on 02 Mar 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc