1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "workflow": "collect",
12 "mode": "search",
13 "query": "kubernetes",
14 "feed": "top",
15 "username": "",
16 "itemIds": [],
17 "sort": "date",
18 "itemTypes": [
19 "story"
20 ],
21 "author": "",
22 "minPoints": 0,
23 "minComments": 0,
24 "domain": "",
25 "dateFrom": "",
26 "dateTo": "",
27 "includeComments": false,
28 "maxCommentsPerItem": 5,
29 "commentDepth": 1,
30 "includeUserProfile": true,
31 "stateNamespace": "default",
32 "firstRunBehavior": "seed_only",
33 "maxResults": 200,
34 "maxBuyerChargeUsd": 1,
35 "maxRuntimeSecs": 180
36};
37
38
39const run = await client.actor("luminar/hackernews-scraper-monitor").call(input);
40
41
42console.log('Results from dataset');
43console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49