Skip to content

Instantly share code, notes, and snippets.

@dipeshhkc
Forked from dipeshdulal/RepoAddInstructions.MD
Last active October 9, 2020 14:14
Show Gist options
  • Save dipeshhkc/214904a3c26c51e75a1e5d4dd964a1b4 to your computer and use it in GitHub Desktop.
Save dipeshhkc/214904a3c26c51e75a1e5d4dd964a1b4 to your computer and use it in GitHub Desktop.
Get a list of created PR's today.

Instructions

  1. Go to github profile page.
  2. Click on today's or some days contribution
  3. Open Inspector Window
  4. Pase the following code
let rollupWrapper = document.querySelectorAll('.profile-rollup-wrapper');

let reportPoints = [];

for(const wrapper of rollupWrapper){
    const heading  = wrapper.querySelector("button > span").innerHTML.trim();
    const opened = heading.startsWith("Opened");
    const reviewed = heading.startsWith("Reviewed");
    if(opened || reviewed) {
       const lists = wrapper.querySelectorAll("li");
       for(const list of lists){
          const reportHeading = list.querySelector(".link-gray-dark").innerHTML.trim();
          const formattedPoints = `${opened ? 'DONE | MERGED': 'DONE | PR REVIEW '} | ${reportHeading}`;
          reportPoints.push(formattedPoints);
       }
    }
}

let output = reportPoints.join("\n")
console.log(output);
  1. Get the list of PR Created and Reviewed today
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment