DEV Community

loading...

Do I really want to write a Google Keep tool?

Bruce Axtens
Programmed Canon Canola calculators in 1977. Assorted platforms and languages ever since. Assisting with HOPL.info. I am NOT looking for work -- I've got more than enough to do.
・1 min read

After writing so many wrappers and so many scraping tools over the last few years, I'm now asking myself: "Do I really want to write tools for Google Keep?" There's been a few folk calling for a Google Keep API but nothing has materialized as yet (AFAICT.)

I do use Keep a lot as a general catchall for interesting web content. Mind you, I use Pocket as well. And PearlTrees. And Zim.

Fiddling with my Keep collection in Firefox Developer sees me trying to spot some structures that could be targeted in Selenium. One item of interest is via document.querySelectorAll(".RNfche"). At this point I don't know if the RNfche class is specific to my collection or to everyone's, but it's on every containing DIV. The number of results of the querySelectAll() increases as one scrolls down the page. Thus, to find every one of them one would have to script Selenium to scroll right down to the bottom of the collection before pulling up the list of RNfche-class elements.

Can I really be bothered?

Discussion (3)

Collapse
mannanj profile image
mannanj

Kind of a crude idea, but why not write a server script using Selenium that goes to Google's website, logins in, exports keep data to like .csv, and then parse that in real time as that file/database endpoint is updated to get your latest keep entries?

Collapse
bscott profile image
Brian Scott

I'm interested in Keep automation but been unsuccessful in finding a Keep API or wrapper that works.

Collapse
bugmagnet profile image
Bruce Axtens Author • Edited

The other thing that could be explored in this regard is BrowserMobProxy which would give you access to the data stream coming down from Google before the browser evaluates it. We've used that for other projects with some success, especially where large JSON blobs received and parsed but not made programmatically available.

I've just looked and there's a tonne of stuff in the HAR describing the Keep experience. BMP would definitely help here.