Skip to content

Commit

Permalink
Added the database parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBone committed Jul 24, 2018
1 parent 3f7bf1c commit 88a3c0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scraper.js
Expand Up @@ -403,7 +403,7 @@ async function parseImage(pdfUrl, image) {

// Parses a single PDF file.

async function parsePdf(pdfUrl, pdf) {
async function parsePdf(database, pdfUrl, pdf) {
for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++) {
console.log(`Examining page ${pageNumber} of ${pdf.numPages} in the PDF.`);

Expand Down Expand Up @@ -484,7 +484,7 @@ async function main() {

console.log(`Retrieving document: ${pdfUrl}`);
let pdf = await pdfjs.getDocument({ url: pdfUrl, disableFontFace: true });
await parsePdf(pdfUrl, pdf); // this inserts development applications into the database
await parsePdf(database, pdfUrl, pdf); // this inserts development applications into the database
}
}

Expand Down

0 comments on commit 88a3c0d

Please sign in to comment.