1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://apify.com/futurizerush"
14 },
15 {
16 "url": "https://rush.zeabur.app/"
17 },
18 {
19 "url": "https://www.threads.com/@futurizerush"
20 }
21 ],
22 "maxRequestsPerCrawl": 10,
23 "maxConcurrency": 3,
24 "smartMode": true,
25 "cacheEnabled": true,
26 "extractionRules": {
27 "article_title": "h1.post-title, h1.article-title, h1.entry-title",
28 "article_content": "article, main, .post-content, .article-content",
29 "author": ".author-name, .by-author, .post-author",
30 "publish_date": "time, .post-date, .publish-date",
31 "category": ".category, .post-category",
32 "tags": ".tags a, .post-tags a"
33 },
34 "customData": {
35 "source": "Apify Actor",
36 "scraped_by": "@futurizerush",
37 "language": "en-US"
38 },
39 "waitForSelector": "",
40 "scrollToBottom": false,
41 "pageLoadTimeoutSecs": 25,
42 "blockResources": []
43};
44
45
46const run = await client.actor("futurizerush/web-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56