rocketchat-google-calendar
rocketchat-google-calendar copied to clipboard
Help
Hey,
Does this still work? I cant post to rocketchat... The linux system (ubuntu) says nth back... and i dont get a notification.. but i disable the script tab and just do a test one it works..
Our setup still works. It sends data to our RocketChat without a problem. Can you try google's own tutorial: https://developers.google.com/calendar/quickstart/python and see if the script in the tutorial works for you?
I get this error..
[34mI20180723-21:16:48.099(2) rocketchat_logger rocketchat_logger.js:278 [31mIntegrations ➔ Incoming WebHook.error [Error running Script in Trigger Kalendar :] [34mI20180723-21:16:48.100(2) rocketchat_logger rocketchat_logger.js:278 [31mIntegrations ➔ Incoming WebHook.error function dateDiff(datepart,fromdate,todate){datepart=datepart.toLowerCase();var diff=todate-fromdate;var divideBy={w:604800000,d:86400000,h:3600000,n:60000,s:1000};return Math.floor(diff/divideBy[datepart])}function getFormattedDate(d,offset){var utc=d.getTime()+d.getTimezoneOffset()*60000;var nd=new Date(utc+3600000*offset);dstr=d.getFullYear()+"-"+("0"+(d.getMonth()+1)).slice(-2)+"-"+("0"+d.getDate()).slice(-2)+" "+nd.toLocaleTimeString();return dstr}var Script=function(){function Script(){}var _proto=Script.prototype;_proto.process_incoming_request=function process_incoming_request(_ref){var request=_ref.request;var myContent=request.content;if(myContent.start.dateTime){var dateStart=new Date(myContent.start.dateTime)}else{var dateStart=new Date(myContent.start.date)}var dateStartText=getFormattedDate(dateStart,2);if(myContent.end.dateTime){var dateEnd=new Date(myContent.end.dateTime)}else{var dateEnd=new Date(myContent.end.date)}var dateEndtText=getFormattedDate(dateEnd,2);var duration=dateDiff("n",dateStart,dateEnd);var durationText;if(duration<300){durationText=duration+" minutes "}else{duration=dateDiff("h",dateStart,dateEnd);durationText=duration+" hours ";if(duration>24){duration=dateDiff("d",dateStart,dateEnd);durationText=durationText+" ( "+duration+" days )"}}var myText=myContent.organizer.displayName+" Calendar Event <br>";myText=myText+"Summary: *"+myContent.summary+"*<br>";myText=myText+"Start: *"+dateStartText+"*<br>";myText=myText+"End: *"+dateEndtText+"*<br>";myText=myText+"Duration: *"+durationText+" * <br>";myText=myText+"Link:\t "+myContent.htmlLink+"<br>";if(myContent.description){myText=myText+"Description: *"+myContent.description+"*<br>"}if(myContent.hangoutLink){myText=myText+"Hangout: "+myContent.hangoutLink+"<br>"}if(myContent.location){myText=myText+"Location: *"+myContent.location+"*<br>"}return{content:{text:myText}}};return Script}(); [34mI20180723-21:16:48.101(2) rocketchat_logger rocketchat_logger.js:278 [31mIntegrations ➔ Incoming WebHook.error [Stack:] [34mI20180723-21:16:48.102(2) rocketchat_logger rocketchat_logger.js:278 [31mIntegrations ➔ Incoming WebHook.error Error: TypeError: Cannot read property 'dateTime' of undefined at Promise.catch (evalmachine.<anonymous>:11:33) at /snap/rocketchat-server/1311/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
I hope you can help me with that..
Okay i finally got it working.. but it only post events that are in the next 30 minutes or so how can i increase this limit?
I am very happy that you made it work.
The limit is defined by the line 76, the variable "now_plus" https://github.com/koyan/rocketchat-google-calendar/blob/master/calendarWebhook.py#L76
You can change the 30 to whatever you prefer.
If you can post here the solution to the problem you had (and how you made it work), it may be helpful if someone else has a similar problem.
I could access the calendar due to the api from google. I just removed Python and pip. Then i tried to get the quickstart guide from google working.
https://developers.google.com/calendar/quickstart/python
Also i used the same files as wanted from the quickstart.py then it somehow worked.
Anyway thanks alot.