Last active
March 22, 2022 14:30
-
-
Save chriswhong/a43565c8ba5c22d90ec967263ef5c44f to your computer and use it in GitHub Desktop.
Revisions
-
chriswhong revised this gist
Mar 22, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,10 @@ // each as a PDF. It also pulls the customer's name from the list and uses it // to create the filename // this script does not paginate. To use navigate to a list of intakes, open // developer tools, paste into the console, press enter // if you have more than one page, manually navigate to the next page and repeat // select all table row elements var rows = document.querySelectorAll("tbody tr") // limit to just one for testing purposes -
chriswhong revised this gist
Mar 22, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var rows = document.querySelectorAll("tbody tr") // iterate over the rows, waiting 5 seconds between each var i = 0; var interval = setInterval(() => { console.log(`downloading form for row ${i}`) var row = rows[i]; // get the customer's name var name = row.querySelectorAll('td:nth-child(3)')[0].textContent.trim() -
chriswhong revised this gist
Mar 22, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,7 @@ var rows = document.querySelectorAll("tbody tr") // iterate over the rows, waiting 5 seconds between each var i = 0; var interval = setInterval(() => { console.log(`downloading for for row ${i}`) var row = rows[i]; // get the customer's name var name = row.querySelectorAll('td:nth-child(3)')[0].textContent.trim() @@ -23,5 +24,4 @@ var interval = setInterval(() => { i++; if(i === rows.length) clearInterval(interval); }, 5000); -
chriswhong created this gist
Mar 22, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ // Bulk download of IntakeQ forms // This script will iterate over the list of intakes in IntakeQ, downloading // each as a PDF. It also pulls the customer's name from the list and uses it // to create the filename // select all table row elements var rows = document.querySelectorAll("tbody tr") // limit to just one for testing purposes // rows = [rows[0]] // iterate over the rows, waiting 5 seconds between each var i = 0; var interval = setInterval(() => { var row = rows[i]; // get the customer's name var name = row.querySelectorAll('td:nth-child(3)')[0].textContent.trim() // get the a tag with the pdf download link var downloadLinkNode = row.querySelectorAll('ul li:nth-child(3) a')[0] // set the download attribute, adding the customer's name downloadLinkNode.setAttribute('download',`${name} - Intake Form`) downloadLinkNode.click() i++; if(i === rows.length) clearInterval(interval); }, 5000);