Tag: 日历

无法让Google Calendar API在NodeJS中工作

我需要一个带有Google日历API的NodeJS服务器来检索事件。 我正在使用谷歌日历库和代码示例, var gcal = require('google-calendar'); var google_calendar = new gcal.GoogleCalendar(accessToken); var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; var passport = require('passport'); var gcal = require('google-calendar'); passport.use(new GoogleStrategy({ clientID: config.consumer_key, clientSecret: config.consumer_secret, callbackURL: "http://localhost:8082/auth/callback", scope: ['openid', 'email', 'https://www.googleapis.com/auth/calendar'] }, function(accessToken, refreshToken, profile, done) { google_calendar = new gcal.GoogleCalendar(accessToken); console.log(google_calendar); return done(null, profile); } )); 我的config.js文件如下: var env = […]

Google日历事件更改时更新数据库

我一直在实施谷歌日历API的一些function。 我有一个自定义日历有能力与谷歌日历同步。 这意味着,您可以创build和编辑日历和事件从我的仪表板到谷歌日历帐户。 我面临的主要问题是,如果我直接从我的谷歌日历更新事件。 我已经实现了推送通知,并得到这样的回应: { "Google_channel_ID": "19835150 – 0057 – 11e6 – bc9c – 1735798 ca540", "Google_channel_token": "calendar_id = 4e7 d5c20ht9lpfdtuukcsvgeq4 @group.calendar.google.com & user_id = 43e d7rxeqqce3fk09ahszc", "Google_channel_expiration": "Tue,12 Apr 2016 12: 34: 36 GMT", "Google_resource_id": "oLMEEhHAw5Xo3r2187CWykjAtm0", "Google_resource_URI": "https: //www.googleapis.com/calendar/v3/calendars/4e7d5c20ht9lpfdtuukcsvgeq4@group.calendar.google.com/events?alt=json", "Google_resource_state": "sync", "Google_message_number": "1" } 但是这个回应是非常一般的。 例如,如果我在此日历上有1000个事件,并更新完整的1000个事件。 我会收到总是相同的通知1000.我想知道,如果有可能得到哪些事件ID有变化,所以我可以执行和更新到我的数据库。 我启动手表的方式是这样的: exports.watch = function(req, res){ var […]

OUTLOOK REST API使用Node.js接受事件

我试图接受使用Rest API的事件,但我无法获得成功的响应,得到这样的答复:{“statusCode”:400,“body”:{“error”:{“code”:“ErrorInvalidRequest” ,“message”:“你的请求不能完成,因为你是会议组织者,所以你不能回应这个会议。”}。 代码试过,直到: function getCalendarOfUser(email, token, startDate, endDate, iCalUId, callback) { console.log("retrieved Start Date: "+startDate+" ,End date: "+endDate); // startDate = '2016-03-10T10:27:00'; //endDate = '2016-05-10T11:27:00'; console.log("Email found in cookie: ", email); console.log("start date : ", startDate + " end date : " + endDate); var optionsForGettingcalendars = { // uri: 'https://outlook.office365.com/api/v2.0/me/calendarview?startDateTime=' + startDate + […]

使用Node.js,Redis和CouchDBpipe理将来的事件通知

我试图在服务器上使用Node.jspipe理date/时间事件通知。 有一种编程模式,我可以使用和适用于JavaScript? 目前,我正在使用命名的setTimeouts和Redis为每个超时存储一个布尔值。 当超时触发时,它检查Redis的布尔值。 如果返回true,则执行通知。 如果该值返回false,这意味着用户已经删除了事件,并没有通知。 这个解决scheme的工作,但我不相信这将是可扩展的,有几个原因: 1)事件可能在几天之后。 我不相信Redis长时间存储这些事件。 2)可能有成千上万的事件,我不希望setTimeouts遍布整个地方。 特别是在事件被删除之后。 我知道这个问题已经解决了,所以我希望有人能指点我一个资源或提供一个共同的模式。

使用服务器作为CalDAV客户端来同步日历数据和问题

对于日历应用程序,我想知道第三方日历事件更改。 例如,用户将iCal / Google日历添加到我的应用程序中。 我的应用程序应该被通知事件的变化。 经过一番研究,似乎CalDAV就是这样做的。 但我不完全了解应用程序应该如何工作。 所以我的理解到目前为止:我将我的服务器作为一个CalDAV客户端。 用户将提供login凭据到我的应用程序从日历中获取数据? 我有两个问题:安全性和性能(如何同步) 安全 这听起来像是有效的,但它是非常不安全的(因为我将不得不提供我的login凭据到一些不受信任的服务器)? 似乎应该使用OAuth呢? 有没有我不正确的理解? 如何同步和性能 我希望收到日历更改的通知(例如,如果用户更新Google日历)。 类似的webhooks应该是最好的。 但是有这样的事情吗? 当我看到NPM中的一个dav包时,似乎就像它的全部拉动一样。 如果我必须不断地调查变化,可能是非常低效的? 我打算使用NodeJS构build服务器