Listings Monitor - News, blogs, issues, articles, products etc.
No credit card required
This Actor may be unreliable while under maintenance. Would you like to try a similar Actor instead?
See alternative ActorsListings Monitor - News, blogs, issues, articles, products etc.
No credit card required
Monitor content and listings on the web using optional keywords and filters. Take actions or receive alerts (e-mail, mobile push notifications etc.) on changes of interest. Use existing configs or easily create or request new ones. Useful for things like news, jobs, articles, products etc.
You can access the Listings Monitor - News, blogs, issues, articles, products etc. programmatically from your own JavaScript applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4// Replace the '<YOUR_API_TOKEN>' with your token
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9// Prepare Actor input
10const input = {
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 // ({price}, {price: oldPrice}) => price < oldPrice,
34 // ]`,
35 "matcher": `// E.g. exclude dynamic "price":
36 // ({price, ...match}) => match`,
37 "pages.retries": 3,
38 "hooks.load": `// async page => {
39 // await page.click('button[name="cookie-consent"]').catch(error => null);
40 // }`,
41 "limits.alerts": 10,
42 "limits.results": 100,
43 "proxy": {
44 "useApifyProxy": false
45 }
46};
47
48// Run the Actor and wait for it to finish
49const run = await client.actor("cyberfly/listingmonitor").call(input);
50
51// Fetch and print Actor results from the run's dataset (if any)
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Listings Monitor - News, blogs, issues, articles, products etc. API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use Listings Monitor - News, blogs, issues, articles, products etc. API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
npm install apify-client
Other API clients include:
Actor Metrics
4 monthly users
-
2 stars
91% runs succeeded
Created in Jan 2024
Modified 4 days ago