1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 "https://docs.python.org/3/whatsnew/index.html",
13 "https://www.federalreserve.gov/newsevents/pressreleases.htm",
14 "https://news.ycombinator.com/",
15 "https://www.gov.uk/government/organisations/hm-treasury"
16 ],
17 "mode": "monitor",
18 "firstRunBehavior": "baseline-only",
19 "watch": [
20 "text",
21 "title"
22 ],
23 "ignore": [],
24 "keywords": [],
25 "minChangePercent": 0,
26 "includeText": false,
27 "maxTextChars": 20000,
28 "webhookUrl": "",
29 "maxUrls": 100,
30 "stateStoreName": "website-change-monitor-state",
31 "maxConcurrency": 5,
32 "maxRunSecs": 240,
33 "proxyConfiguration": {
34 "useApifyProxy": true
35 }
36};
37
38
39const run = await client.actor("insight.solutions/website-change-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