-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.js
33 lines (32 loc) · 1.04 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const csdnCrawler = require('./index')
const exampleOptions = {
username: 'weixin_45534242',
page: 1,
size: 5,
link: '',
businessType: 'blog',
sleepTime: null, // Unit is: ms
supportImageType: ['jpg', 'png', 'jpeg', 'webp', 'gif', 'mp4', 'bmp', 'svg'],
imagePrefixName: 'crawl-',
contentNodeIdentify: '#article_content',
qiniu: {
zone: '',
scope: '', // Your qiniu scope name. Storage name.
useHttpsDomain: true,
useCdnDomain: true,
baseQiNiuCdnApi: '',
remoteFilePath: '/openStatic',
isNeedWaterMark: false,
imageStyleSplitQuote: '&',
imageStyleName: '',
accessKey: '', // Qiniu cloud accessKey
secretKey: '', // Qiniu secretKey
imageBaseAlt: '' // image base alt message prefix
}
}
csdnCrawler(exampleOptions, data => {
console.log(`==============================`)
console.log(`=== Demo Crawl Succeed !!!===`)
console.log(`==============================`)
console.log(`Total Data length : ${data.length}`)
})