-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update prettier formatting for README.md, src/config.ts, src/core.ts,…
… and config.ts and formatting for jsdoc/typedoc as recommened by @marcelovicentegc in pull request #102, added .prettierignore file
- Loading branch information
Showing
5 changed files
with
215 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Ignore artifacts | ||
|
||
node_modules | ||
.github | ||
storage | ||
outputs | ||
*.code-workspace | ||
|
||
## This file tells which files shouldn't be added to source control | ||
|
||
.idea | ||
dist | ||
node_modules | ||
apify_storage | ||
crawlee_storage | ||
storage | ||
.DS_Store | ||
|
||
## any output from the crawler | ||
|
||
*.json | ||
pnpm-lock.yaml | ||
|
||
## Final ouputs folder | ||
|
||
outputs | ||
|
||
## VS Code workspace files | ||
|
||
*.code-workspace |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
import { Config } from "./src/config"; | ||
import { fileURLToPath } from 'url'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from "url"; | ||
import { dirname } from "path"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = dirname(__filename); | ||
|
||
const starting_url = "https://www.builder.io/c/docs/developers"; | ||
const url_prefix = "https://" | ||
const startingUrl = "https://www.builder.io/c/docs/developers"; | ||
const urlPrefix = "https://"; | ||
const domain = "www.builder.io"; | ||
const url_suffix = "/c/docs"; | ||
const base_url = url_prefix + domain; | ||
const match_url_prefix = base_url + url_suffix; | ||
const match_url = match_url_prefix + "/**"; | ||
const urlSuffix = "/c/docs"; | ||
const baseUrl = urlPrefix + domain; | ||
const matchUrl_prefix = baseUrl + urlSuffix; | ||
const matchUrl = matchUrl_prefix + "/**"; | ||
|
||
// Now date stamp for output file name | ||
const now = new Date(); | ||
const date = now.toISOString().split('T')[0]; | ||
const time = now.toTimeString().split(' ')[0]; | ||
const outputs_dir = __dirname.split('/').slice(0, -1).join('/') + '/outputs'; | ||
const date = now.toISOString().split("T")[0]; | ||
const time = now.toTimeString().split(" ")[0]; | ||
const outputs_dir = __dirname.split("/").slice(0, -1).join("/") + "/outputs"; | ||
|
||
const outputFileName = outputs_dir + "/" + domain + "-" + date + "-" + time + ".json"; | ||
const outputFileName = | ||
outputs_dir + "/" + domain + "-" + date + "-" + time + ".json"; | ||
|
||
export const defaultConfig: Config = { | ||
url: starting_url, | ||
match: match_url, | ||
url: startingUrl, | ||
match: matchUrl, | ||
maxPagesToCrawl: 50, | ||
outputFileName: outputFileName, | ||
waitPerPageCrawlTimeoutRange: {min:1000, max:1000}, | ||
outputFileName: outputFileName, | ||
waitPerPageCrawlTimeoutRange: { min: 1000, max: 1000 }, | ||
headless: true, | ||
maxConcurrency: 1, | ||
}; |
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.