-
Notifications
You must be signed in to change notification settings - Fork 2
/
Google-Docs-Grabber.jsx
85 lines (70 loc) · 1.97 KB
/
Google-Docs-Grabber.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//****************************
// Client Code
//****************************
if (Meteor.isClient) {
// This code is executed on the client only
var scopes = ['https://www.googleapis.com/auth/drive'];
Accounts.ui.config({
'passwordSignupFields': 'USERNAME_ONLY',
'requestPermissions': { 'google': scopes },
});
Meteor.subscribe("tasks");
Meteor.startup(function () {
// Use Meteor.startup to render the component after the page is ready
React.render(<App />, document.getElementById("render-target"));
});
}
//****************************
// Server Code
//****************************
if (Meteor.isServer) {
// Only publish tasks that are public or belong to the current user
Meteor.publish("tasks", function() {
return Tasks.find({
$or: [
{ private: { $ne: true } },
{ owner: this.userId }
]
});
});
Meteor.methods({
getSlides(userId) {
// this.unblock();
return Meteor.http.call('GET', 'https://www.googleapis.com/drive/v2/files', { params: {user: userId}}, function(err, results) {
console.log('err', err);
console.log('results', results);
});
const options = {
headers: {
Authentication: 'Bearer '
}
}
HTTP.get('https://www.googleapis.com/drive/v2/files', options)
},
})
}
//****************************
// Shared methods
//****************************
Meteor.methods({
});
// if (Meteor.isClient) {
// // counter starts at 0
// Session.setDefault('counter', 0);
// Template.hello.helpers({
// counter: function () {
// return Session.get('counter');
// }
// });
// Template.hello.events({
// 'click button': function () {
// // increment the counter when button is clicked
// Session.set('counter', Session.get('counter') + 1);
// }
// });
// }
// if (Meteor.isServer) {
// Meteor.startup(function () {
// // code to run on server at startup
// });
// }