Listings Monitor - News, blogs, issues, articles, products etc. avatar
Listings Monitor - News, blogs, issues, articles, products etc.
Try for free

No credit card required

View all Actors
Listings Monitor - News, blogs, issues, articles, products etc.

Listings Monitor - News, blogs, issues, articles, products etc.

cyberfly/listingmonitor
Try for free

No credit card required

Easily monitor any list of items anywhere on the web for updates and optional keywords and receive alerts (e-mail, mobile push notifications etc.) on changes of interest. Use existing watchers, easily create new ones or request new configs. Useful for any lists, listings, articles, products, etc.

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more

Node.js

Python

curl

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "url": "https://news.ycombinator.com/news",
11    "selectors": [
12        "table table tr[class='athing'] td:nth-child(3) > span > a"
13    ],
14    "scrapers": `// (input) => ({
15        //     title: {
16        //         selectors: ["table table tr[class='athing'] td:nth-child(3) > span > a"],
17        //         extractor: node => node.innerText,
18        //     },
19        //     links: {
20        //         contents: {
21        //             selectors: ["table table tr[class='athing'] td:nth-child(3) > span > a"],
22        //             extractor: node => node.href,
23        //         },
24        //         comments: {
25        //             selectors: ["table table tr td[class='subtext'] span a[href^=item]:first-child"],
26        //             extractor: node => node.href,
27        //         },
28        //     },
29        // })`,
30    "filters": `// [
31        // 	({title}) => title.length > 1,
32        // 	({links}) => links.contents.includes('http'),
33        // ]`,
34    "proxy": {
35        "useApifyProxy": false
36    }
37};
38
39(async () => {
40    // Run the Actor and wait for it to finish
41    const run = await client.actor("cyberfly/listingmonitor").call(input);
42
43    // Fetch and print Actor results from the run's dataset (if any)
44    console.log('Results from dataset');
45    console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46    const { items } = await client.dataset(run.defaultDatasetId).listItems();
47    items.forEach((item) => {
48        console.dir(item);
49    });
50})();
51
52// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Developer
Maintained by Community
Actor metrics
  • 6 monthly users
  • 100.0% runs succeeded
  • days response time
  • Created in Jan 2024
  • Modified about 1 month ago
Categories