1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "pages": [
12 {
13 "url": "https://www.apify.com/pricing",
14 "name": "Apify pricing",
15 "selector": null
16 },
17 {
18 "url": "https://nodejs.org/en/blog",
19 "name": "Node.js releases"
20 },
21 {
22 "url": "https://www.gov.uk/government/announcements",
23 "name": "GOV.UK announcements"
24 }
25 ],
26 "trackingId": "my-watch",
27 "ignorePatterns": [
28 "Last updated:.*",
29 "\\d{1,2}:\\d{2}\\s*(AM|PM)?"
30 ],
31 "proxyConfiguration": {
32 "useApifyProxy": true
33 }
34};
35
36
37const run = await client.actor("almoutasem_nabil/page-change-monitor").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47