Read a Google Drive Doc and convert to JSON (via ArchieML)
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
test
.gitignore
README.md
config.example.json
index.js
package.json

README.md

googledoc-to-json

Node.js library to read a Google Drive Doc and convert to JSON (via ArchieML)

This is a work-in-progress.

Install

npm install googledoc-to-json --save

Example

see 'test' folder

or run:

 $ npm test

CLI

$ npm install -g googledoc-to-json
$ googledoc-to-json <doc-id> -c config.json -o output.json

Getting credentials

  1. Got to https://console.developers.google.com
  2. Create an account
  3. In the right sidebar click Credentials
  4. Then click Create credentials, select oAuth client ID, select Web application
  5. Name your Web Application
  6. Enter https://developers.google.com/oauthplayground as an authorized redirect URLs
  7. Have your Client ID and Client secret ready
  8. Go to https://developers.google.com/oauthplayground/
  9. Under Step 1 authorize all Dirve API v3
  10. Click the Gear button in upper right of the page and check Use your own OAuth credentials
  11. Enter your Client ID and Client secret
  12. Click Authorize APIs
  13. Then request auth tokens, grab generated the refresh token.
  14. Create a config.json in your project with your info:
{
  "google": {
    "client_id": “yourID”,
    "client_secret": “yourSecret”,
    "oAuthTokens":{"refresh_token": “yourRefreshToken”},
    "redirect_urls":["http://localhost:####"]
  }
} 

Todos:

  • Add Mocha tests