Cancel All Google Calendar Watch Requests - google-calendar-api

Problem
Due to the haphazard creation and management of watch requests to certain calendar id's, the resource_ids for these watch notifications have been lost. In order to cancel the requests, the resource_id must be included in the request.
Question(s)
Is there any way to poll Google (using the channel_id or through other means) for the missing resource_id?
Is there a way cancel the push request programmatically through other means?
Is there a way to collectively cancel all active watch requests through the Google developer console?
Context
This is being written in node.js but the question really applies to any platform.

No, unfortunately push notification channels cannot be list or cancelled without the resource ID returned when they were created. Luckily they have a relatively short lifespan, so the problem should go away naturally.

Related

Sync external planning with Google agenda private API

We're developing an agenda on our platform. We implemented a feature to sync with Google Agenda which works correctly except that it only works with public calendar and not when it's private.
We implement everything as Google provides and use AuthO2 protocol.
We are migrating to https and we hope that it will solve our issue.
Do you have any idea on the reason it's blocked when agenda is private?
You can implement synchronization by sending HTTP request:
GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events
and adding path parameters and optional query parameters as shown in Events: list.
In addition to that, referring to Synchronize Resources Efficiently, you can keep data for all calendar collections in sync while saving bandwidth by using the "incremental synchronization".
As highlighted in the documentation:
A sync token is a piece of data exchanged between the server and the client, and has a critical role in the synchronization process.
As you may have noticed, sync token takes a major part in both stages in incremental synchronization. Make sure to store this syncToken for the next sync request. As discussed:
Initial full sync is performed once at the very beginning in order to fully synchronize the client’s state with the server’s state. The client will obtain a sync token that it needs to persist.
Incremental sync is performed repeatedly and updates the client with all the changes that happened ever since the previous sync. Each time, the client provides the previous sync token it obtained from the server and stores the new sync token from the response.
More information and examples on how to synchronize efficiently can be found in the given documentations.

How to customize the delay between event notifications in Artifactory?

Artifactory has a neat feature of sending emails for changed repositories but I wasn't able to find a place where I can configure how much time to wait before sending such notification.
As a result it does send lots of incremental emails if you are trying to upload a lot of data.
I suspect that it does have a place where this happens because the notifications are send in batches, not one per uploaded artifact.
The delay between event notification email is 60 seconds.
Currently, there is no easy way of changing this value.
It could be a nice feature request.

Use GAE background thread to trigger SSE to multiple web clients

All,
I have completed the basic GAE "Guestbook" example which uses Google Cloud Endpoints and Google Cloud Messaging. I can successfully add a note to the guestbook and have it appear on all registered devices.
I've also used the super simple Server Sent Event (SSE) mechanism to have a web page initiate an event source and then update itself as events are received. But separate web pages appear to create their own distinct event sources (even if using the same URI to the event source) and thus get their own events at their own times.
The objective here is to create a bit of collaboration such that user actions can come from an android device or a web page and the effects the received action are then pushed to all connected users/devices/web pages.
I have assumed I will need a background module and that both Endpoints and 'normal' web pages / queries would channel the received user action to that background module. I believe I can get that far. Next, I need the background module to trigger a push notification to all interested parties.
I believe I can trigger a Google Could Messaging event to registered Android devices from that background module.
But it isn't clear to me how a background module can be the source of an SSE, or how the background module can best communicate with a foreground module that already is the source of an SSE.
I've looked at the Google Queue API, but I have a feeling I'm making something quite easy much more difficult than it needs to be. If you were not going to 'poll' for changes from a web page... and you wanted to receive notifications from an SSE source when changes were made by other users, possibly using Android devices rather than a typical web page, and the deployed application is running on the Google Application Engine, what would you recommend?
Many thanks,
Randy
You are on the right track, not really sure why you are using the background module but from what i understood you need to:
Your front end module receives an update
You retrieve a list of all devices receiving that update
Use the Queue service to send the update via GCM to every single device
Why use queues? because front end instances have a 1 min time limit per request and you'll need to queue work in order to go beyond that time to serve you (potentially) thousands of users.
Now, If you already have a backend instance (which does not have the 1min limit) you could just iterate over the list and send all messages on one request. I believe you have a 24 hr request limit so you should be OK. But in this scenario you don't have need for the front end module, you can just hit this server straight up.

Capturing http data packets on chrome as long as browser active

I'm trying to develop a chrome extension which will capture http packets, their source and destination URLS, the packet size.
Basically I want to know how much time the user spends on a particular site for the duration the browser is active.
I used JNetPcap and successfully have written a java code for the same but i cant find a way to implement the browser close event in Java.
Also chrome extensions need to be in javascript.
Can anyone suggest a way to go about this?
Your initial approach is flawed to begin with. What do you mean by "time spent on a site"? The page loads, packets cease to flow, yet the user is still reading the page. Just network analysis is hardly a good metric.
And what about external resources? Do your users "spend time" on Google Analytics website when trackers make their requests?
If you are dead-set on network capture, chrome.webRequest or chrome.webNavigation APIs should let you tap into requests made by the client.
As for implementing this properly as a Chrome extension, it should be trivial. You can use chrome.tabs API to keep track of open/active tabs.
Declare "tabs" permission to get access to URL data
On initialization, query current tabs (or just the active tab)
Listen to onCreated for new tabs, or better yet for onActivated for change of visible tab (possibly do so with windows too, there's a separate API for that)
Within the active tab, track URL changes with onUpdated
If you're new to extension development, start with the Overview. Good read, and a good hub to other documentation.
As for recommending JavaScript resources, I'll pass; too many of them.

Google Calendar API DoS prevention

It appears that the Google calendar API effectively locks you out if you create and delete a few (less than 10) calendars within a short space of time.
This has made it basically impossible for me to test my app, because it creates/deletes a calendar for each user that is added/removed from the app. Currently, I'm "working around" this issue by creating a new Google account each time I get locked out of the Calendar API. Clearly, this solution is less than satisfactory.
Is there any way I can avoid this over-zealous DoS prevention?
Thanks,
Don
If your application doesn't require an instantaneous call out to the Google API, your code can queue the actions and throttle the calls to x calls over y seconds. Not an ideal solution but it would reduce the likelihood of hitting the quota limit.
Can't you just "reset" (i.e. delete all entries) the test calendars instead of re-creating them every time?
Try creating a localized version of the calendar that you either have the user save (upload to Google) with a button click or as an event (ie. closing the program, every x minutes). Store all the data locally, and only upload to Google as needed. I don't know how neccessary it is that the data be available immediately, but if your app can handle some delay, then this may work for you.

Resources