Skip to content

Commit c3f90bb

Browse files
committed
docs: update
1 parent aded4a5 commit c3f90bb

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If it helps you, please give the [repository](https://github.com/coder-hxl/x-cra
1212
- The built-in puppeteer crawls the page, and uses the jsdom library to parse the page.
1313
- Support asynchronous/synchronous way to crawl data.
1414
- Support Promise/Callback method to get the result.
15-
- Polling function, fixed-point crawling.
15+
- Polling function, timing crawling.
1616
- Anthropomorphic request interval.
1717
- Written in TypeScript, providing generics.
1818

@@ -86,7 +86,7 @@ npm install x-crawl
8686

8787
## Example
8888

89-
Example of fetching featured video cover image for youtube homepage every other day:
89+
Regular crawling: Get the recommended pictures of the youtube homepage every other day as an example:
9090

9191
```js
9292
// 1.Import module ES/CJS
@@ -135,7 +135,7 @@ running result:
135135
<img src="https://raw.githubusercontent.com/coder-hxl/x-crawl/main/assets/en/crawler-result.png" />
136136
</div>
137137

138-
**Note:** Do not crawl randomly, here is just to demonstrate how to use x-crawl, and control the request frequency within 3000ms to 2000ms.
138+
**Note:** Do not crawl at will, you can check the **robots.txt** protocol before crawling. This is just to demonstrate how to use x-crawl.
139139

140140
## Core concepts
141141

docs/cn.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ x-crawl 是 Nodejs 多功能爬虫库。
1212
- 内置 puppeteer 爬取页面 ,并用采用 jsdom 库对页面解析。
1313
- 支持 异步/同步 方式爬取数据。
1414
- 支持 Promise/Callback 方式获取结果。
15-
- 轮询功能,定点爬取
15+
- 轮询功能,定时爬取
1616
- 拟人化的请求间隔时间。
1717
- 使用 TypeScript 编写,提供泛型。
1818

@@ -85,7 +85,7 @@ npm install x-crawl
8585

8686
## 示例
8787

88-
每隔一天就获取 bilibili 国漫主页的轮播图片为例:
88+
定时爬取: 每隔一天就获取 bilibili 国漫主页的轮播图片为例:
8989

9090
```js
9191
// 1.导入模块 ES/CJS
@@ -126,8 +126,7 @@ myXCrawl.startPolling({ d: 1 }, () => {
126126
<div align="center">
127127
<img src="https://raw.githubusercontent.com/coder-hxl/x-crawl/main/assets/cn/crawler-result.png" />
128128
</div>
129-
130-
**注意:** 请勿随意爬取,这里只是为了演示如何使用 x-crawl ,并将请求频率控制在 3000ms 到 2000ms 内。
129+
**注意:** 请勿随意爬取,爬取前可查看 **robots.txt** 协议。这里只是为了演示如何使用 x-crawl 。
131130
132131
## 核心概念
133132

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "x-crawl",
4-
"version": "2.4.0",
4+
"version": "2.4.2",
55
"author": "coderHXL",
66
"description": "XCrawl is a Nodejs multifunctional crawler library.",
77
"license": "MIT",

publish/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If it helps you, please give the [repository](https://github.com/coder-hxl/x-cra
1212
- The built-in puppeteer crawls the page, and uses the jsdom library to parse the page.
1313
- Support asynchronous/synchronous way to crawl data.
1414
- Support Promise/Callback method to get the result.
15-
- Polling function, fixed-point crawling.
15+
- Polling function, timing crawling.
1616
- Anthropomorphic request interval.
1717
- Written in TypeScript, providing generics.
1818

@@ -86,7 +86,7 @@ npm install x-crawl
8686

8787
## Example
8888

89-
Example of fetching featured video cover image for youtube homepage every other day:
89+
Regular crawling: Get the recommended pictures of the youtube homepage every other day as an example:
9090

9191
```js
9292
// 1.Import module ES/CJS
@@ -135,7 +135,7 @@ running result:
135135
<img src="https://raw.githubusercontent.com/coder-hxl/x-crawl/main/assets/en/crawler-result.png" />
136136
</div>
137137

138-
**Note:** Do not crawl randomly, here is just to demonstrate how to use x-crawl, and control the request frequency within 3000ms to 2000ms.
138+
**Note:** Do not crawl at will, you can check the **robots.txt** protocol before crawling. This is just to demonstrate how to use x-crawl.
139139

140140
## Core concepts
141141

publish/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "x-crawl",
3-
"version": "2.4.0",
3+
"version": "2.4.2",
44
"author": "coderHXL",
55
"description": "XCrawl is a Nodejs multifunctional crawler library.",
66
"license": "MIT",

src/api.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ function mergeConfig<T extends MergeConfigRawConfig>(
6262
}
6363

6464
// 2.处理 intervalTime
65-
if (
66-
Object.hasOwn(newConfig, 'intervalTime') &&
67-
isUndefined(newConfig.intervalTime)
68-
) {
65+
if (isUndefined(newConfig.intervalTime)) {
6966
newConfig.intervalTime = baseConfig.intervalTime
7067
}
7168

test/start/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)