@fcc-cdc/it-events
Version:
IT Events Crawler of China
70 lines (47 loc) • 1.78 kB
Markdown
核心创意源自 [@too][1] 的[一个想法][2],核心代码源自 [@TechQuery][3] 的[《NodeJS 网页爬虫一小时实战》课程][4]。
[][5]
[][6]
[][7]
```Shell
npm install @fcc-cdc/it-events -g
it-events list -i 0.5 1> ~/Desktop/it-events.yml
```
```JavaScript
import updateEvents, { descendDate } from '@fcc-cdc/it-events';
(async () => {
const list = [];
for await (let item of updateEvents(list, 0.5)) list.push(item);
console.log([...new Set(list)].sort(descendDate));
})();
```
```shell
it-events agenda https://www.bagevent.com/event/8199059
it-events agenda https://www.bagevent.com/event/6840909/p/430761
```
```javascript
import { BagEventAgenda } from 'it-events';
// 议程在首页
new BagEventAgenda().saveList('https://www.bagevent.com/event/8199059');
// 议程在内页
new BagEventAgenda().saveList(
'https://www.bagevent.com/event/6840909/p/430761'
);
```
[]: https://github.com/too
[]: ./Contributing.md
[]: https://github.com/TechQuery
[]: https://fcc-cd.dev/activity/workshop/nodejs-web-crawler/
[]: https://david-dm.org/FreeCodeCamp-Chengdu/IT-events
[]: https://github.com/FreeCodeCamp-Chengdu/IT-events/actions/workflows/main.yml
[]: https://nodei.co/npm/@fcc-cdc/it-events/