
Hacker News keyword alert
Deprecated
Pricing
Pay per usage

Hacker News keyword alert
Deprecated
Actor for the Apify platform that allows receiving notifications when a keyword is mentioned on Hacker News. This enables many use-cases, such as allowing businesses to monitor mentions of their brand, or monitoring news around your favorite technology
0.0 (0)
Pricing
Pay per usage
3
Total users
23
Monthly users
4
Last modified
2 years ago
Hacker News keyword alert is an actor for the Apify platform that allows you to get notified whenever a given keyword is mentioned in a Hacker News post or comment.
This is especially useful for brands – this actor enables you to catch and reply to negative mentions of your company before they get viral, and you have no chance of responding without your reply drowning in the storm.
Usage
For experienced Apify users: just set a schedule executing this actor regularly and either provide an email in actor input, or use some integration.
Step by step setup
- Open this actor in the Apify Console (you will need to create an account if you don't have one).
- In the top right, open the Actions dropdown and select Schedule actor. After you choose a name for your schedule, you will be presented with a schedule edit page.
- Setup the schedule frequency: click the Change button next under the Schedule header.
- If you choose Custom occurence, you can set a more specific frequency like every X minutes.
- Save the frequency setting.
- Switch to the Actors and Tasks tab.
- This scraper will be already pre-configured there – click Edit to setup the target keyword.
- Set the keyword to receive notifications for, and the email to receive notifications on (you can also leave the email field empty and setup other integrations, see below).
- (Optional, but recommended) Set a lower timeout for the scheduled actor – this actor's run should never take a long time, so you can set a lower run-time limit, for example 90 seconds.
- Save the actor configuration changes.
- Go back to the Settings tab and save the new configuration.
Actor output
If you want to create your custom integration, you need to know about the output format it provides.
Note that not every run produces some results, so you need to check that.
Dataset
Each actor run has a default dataset assigned by the Apify Console. This actor puts into the dataset an entry for each new mention found. So each row looks something like this:
{"created_at": "2022-06-08T19:00:00.000Z","created_at_i": 1654714800,"title": null,"url": null,"author": "johndoe","points": null,"story_text": null,"comment_text": "This is an example.<p>It's a very simple subset of HTML, as is typical to HN. This is what a link looks like <a href=\"https://example.com/\" rel=\"nofollow\">https://example.com/</a>","num_comments": null,"story_id": 123456,"story_title": "Some post name","story_url": "https://example.com/","parent_id": 123456,"_tags": ["comment", "author_johndoe", "story_123456"],"objectID": 1234567}
The available (non-null) properties differ by item type (which you have to infer) - keyword matches in comments have comment_text
, story_title
and story_url
, top-level posts always have a title
. Availability of url
and story_text
differs - some stories have it, some not.
OUTPUT
in default Key-value store
For your convenience, this actor also provides OUTPUT
(in text/plain
, very simple markdown format) in the default key-value store, which contains a user-readable summary of each match, including a link to Hacker News and relevant fields. This is the format that is sent by email if you provide one in actor input.
Example:
**New mentions of 'keyword' on Hacker news**Comment by jane_doe on post 'Some post name' (https://example.com/):This is an exampleIt's a very simple subset of HTML, as is typical to HN. This is what a link looks like https://example.com/HN link: https://news.ycombinator.com/item?id=1234567Post 'Some post name' posted by johndoe (https://example.com/)HN link: https://news.ycombinator.com/item?id=123456
This value is missing when there's no new items found.
hacker-news-search-alert
named Key-value store
The actor uses this named, persistent key-value store to save identifier of the last seen item for each query. If you remove a value from this store or start the scraper for the first time on a given keyword, the actor will return the last 20 items.
Custom integrations
If email notifications are unsuitable for your use-case, you can use Apify integrations to run a webhook after each run.
There are two options:
Add directly to actor
This sets the integration for your actor globally, for all runs. This means if you'll want to setup multiple different monitors, each of them will trigger this same webhook.
To setup:
- Open the Actors page in Apify Console.
- Find this actor (
mvolfik/hacker-news-keyword-alert
– Direct link). - Switch to the Integrations tab.
- Click Add new webhook.
- Setup your webhook. The most useful variable to you is
resource
: for Run succeeded events, this contains data about the actor output dataset and key-value stores. See below for details about this Actor's output. - Don't forget to save the integration.
Create a new task & add the integration there
- Open the Actors page in Apify Console.
- Find this actor (
mvolfik/hacker-news-keyword-alert
– Direct link). - In the top right, click Create empty task.
- Configure the task input the same way as you configured the actor in the schedule and click Save.
- Go to the Settings and rename the task so you can easily identify it - you'll probably want to mention the keyword in the name (don't forget to click Save again).
- Open the Integrations tab and follow steps 4-6 above as if you were adding the integration to the actor.
- Now go the the Schedules page in Apify Console and open the schedule you created earlier, or create a new one.
- In the Actors and Tasks tab, click Add new, and add a Task.
- Now select the task you created earlier. In the Input JSON overrides field, leave the default value
{}
(this means an empty object, i.e. no overrides). - Save the task.