FusionTablesAPI

This gem allows you to use Google's FusionTables API to create and upload tables with a CSV file.

Installation

Add this line to your application's Gemfile:

gem 'fusion_tables_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fusion_tables_api

Usage

cred = {
  client_id: "check-your-google-api-console-for-this",
  client_secret: "same-thing-as-above"
}

tokens = {
  access_token: "if-you-have-the-access-token-then-use-it",
  refresh_token: "refresh-token-would-be-useful-too"
}

google_api_client_options {
 application_name: "AppName"
 application_version: "1.0awesome"
}

ft = FusionTablesAPI.new(cred, tokens, google_api_client_options)
jj ft.get_table_list

OR

ft = FusionTablesAPI.new("google_oauth_credentials.yml", "google_access_token.yml", google_api_client_options)
jj ft.get_table_list

Generating a table:

jj ft.generate_table("the_name_of_csv_file.csv")

If you need to retrieve your access token and refresh token for the first time utilize the method: ft.initial_authorization

Customize the GoogleAPIClient by accessing the property ft.client for e.g. ft.client.authorization.access_token ft.client.authorization.access_token = "12345" ft.client.authorization.redirect_uri = "http://www.example.com"

See http://rubydoc.info/github/google/google-api-ruby-client/frames for more info.

TODO: Finish this....

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Copyright (c) 2013 Michael Villena

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.