()
| 4 | import StringUtils from './utils/string'; |
| 5 | |
| 6 | async function run() { |
| 7 | const communities = [ |
| 8 | { |
| 9 | communityName: 'threads.netmaker.io', |
| 10 | url: 'https://docs.netmaker.io', |
| 11 | selectors: ['div.md-content'], |
| 12 | }, |
| 13 | { |
| 14 | communityName: 'discuss.flyte.org', |
| 15 | url: 'https://docs.flyte.org', |
| 16 | selectors: ['article[role="main"]'], |
| 17 | }, |
| 18 | ]; |
| 19 | |
| 20 | for (const record of communities) { |
| 21 | const { url, communityName } = record; |
| 22 | const community = await Linen.getCommunityInfo(communityName); |
| 23 | await LangChain.crawlToStore({ |
| 24 | url, |
| 25 | communityName: community.name, |
| 26 | options: { |
| 27 | selectors: record.selectors, |
| 28 | output: join(__dirname, '../.db/crawl', StringUtils.clean(url)), |
| 29 | }, |
| 30 | }); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | run(); |
no test coverage detected