Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add google docs action items? #11

Open
mozfreddyb opened this issue Oct 18, 2018 · 2 comments
Open

Add google docs action items? #11

mozfreddyb opened this issue Oct 18, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@mozfreddyb
Copy link

Google docs has a way to assign comments to specific people which leads to action items floating around and it makes me sad that people try to assign stuff to me.

Mostly, because there is no great overview to see which documents have assigned actions and how many there are. The only thing you can do is go to https://docs.google.com/document/u/0/?tgif=d and scrape it like so

// loop through list of docs
for (let doc of document.querySelectorAll(".docs-homescreen-list-item-title")) {
    // find those that have an action item count
    for (let needsFollowUp of doc.querySelectorAll(".docsshared-action-items-badge-count")) {
        let docTitle = doc.title;
        let amnt = needsFollowUp.textContent;
        let url = ""; //FIXME
        
    }
}```
@Callek
Copy link
Contributor

Callek commented Oct 19, 2018

Note: this won't work for me, as I have 3 google accounts all of which are logged in at once, and 1 of which doesn't even have docs enabled...

@mikeconley mikeconley added the enhancement New feature or request label Oct 24, 2018
@mozfreddyb
Copy link
Author

Turns out there is an overview page at https://drive.google.com/drive/u/0/search?q=followup:actionitems

The markup is a bit horrible to navigate and I'm somewhat fearful that it might change, but here's how to get the action items with document name + type (sheet, doc, presentation etc.)

let files = $$(".a-u-xb-j.a-Wa-ka")
for (let file of files) {
    // image is slides/sheets/doc logo and has an alt tag
    let typeImg = file.querySelector("img.a-Ua-c");
    // strip off "Google" from "Google Slides" (and docs, sheets etc.)
    let type = "Unknown";
    if (typeImg) {
      type = typeImg.alt.indexOf("Google") == 0 ? typeImg.alt.slice(7) : "Unknown";
    }
    let title = file.querySelector(".l-u-V[aria-label]").getAttribute("aria-label");
    let actions = file.querySelector("div.ocLVN-Y-Sn-og-yc").innerText;
    console.log({actions, type, title});

}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants