-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename collector() to collect(), add types, and convert example.js to…
… ts (#57) * Add types for collector arguments and convert example.js to ts * Update README to reflect collector changes * Rename collector to collect * Pass device type instead of string
- Loading branch information
Showing
7 changed files
with
96 additions
and
127 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file was deleted.
Oops, something went wrong.
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
import { KnownDevices } from "puppeteer"; | ||
import { CollectorOptions, collect } from "./src"; | ||
import { join } from 'path'; | ||
|
||
(async () => { | ||
const URL = 'example.com'; | ||
const EMULATE_DEVICE = 'iPhone 13 Mini'; | ||
|
||
const config: CollectorOptions = { | ||
numPages: 3, | ||
headless: false, | ||
//emulateDevice: KnownDevices[EMULATE_DEVICE], | ||
// Uncomment to run with desktop/laptop browser | ||
// emulateDevice: { | ||
// viewport: {height: 1440, width: 800}, | ||
// userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" | ||
// }, | ||
outDir: join(__dirname, 'demo-dir'), | ||
}; | ||
|
||
console.log(`Beginning scan of ${URL}`); | ||
|
||
await collect(`http://${URL}`, config); | ||
|
||
console.log(`Scan complete: ${config.outDir}`); | ||
})(); |
This file contains 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 characters
This file contains 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 characters
Oops, something went wrong.