Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Google Drive example #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/google_drive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var htmlparser = require('htmlparser2');
var Entities = require('html-entities').AllHtmlEntities;

// Grab google packages and the drive api
var google = require('googleapis');
var { google } = require('googleapis');
var drive = google.drive('v2');

// Set up auth
Expand Down Expand Up @@ -59,8 +59,8 @@ app.get('/oauth2callback', function (req, res) {
// so if you want to preserve them, we have to export the document in a
// different format, `text/html`.

export_link = doc.exportLinks['text/html'];
oauth2Client._makeRequest({method: "GET", uri: export_link}, function(err, body) {
export_link = doc.data.exportLinks['text/html'];
oauth2Client.request({method: "GET", url: export_link}, function(err, body) {

var handler = new htmlparser.DomHandler(function(error, dom) {
var tagHandlers = {
Expand Down Expand Up @@ -126,7 +126,7 @@ app.get('/oauth2callback', function (req, res) {

var parser = new htmlparser.Parser(handler);

parser.write(body);
parser.write(body.data);
parser.done();
});
});
Expand Down