Send Top "Show HN" Stories From Hacker News
Using Steampipe and the Hacker News plugin, list the top "Show HN" stories from Hacker News ordered by score and send them in an email using SendGrid.
If run with flowpipe server
, this mod will send an email every day at 12 PM UTC.
Requirements
Install Steampipe and the Hacker News plugin.
Then start Steampipe with steampipe service start
.
Docker daemon must be installed and running. Please see Install Docker Engine for more information.
Installation
Download and install Flowpipe (https://flowpipe.io/downloads). Or use Brew:
brew tap turbot/tapbrew install flowpipe
Clone:
git clone https://github.com/turbot/flowpipe-samples.gitcd productivity/send_top_show_hn_email
flowpipe mod install
Connections
By default, the following environment variables will be used for authentication:
SENDGRID_API_KEY
You can also create connection
resources in configuration files:
vi ~/.flowpipe/config/sendgrid.fpc
connection "sendgrid" "default" { api_key = "SG.R6pHsRv..."}
For more information on connections in Flowpipe, please see Managing Connectionss.
Usage
Run the pipeline to send an email immediately:
flowpipe pipeline run send_top_show_hn_email
To send an email at the scheduled time, start the Flowpipe server:
flowpipe server
Once started, Flowpipe will run the pipeline automatically at the scheduled time.
Configuration
To avoid entering variable values when running the pipeline or starting the server, you can set variable values:
cp flowpipe.fpvars.example flowpipe.fpvarsvi flowpipe.fpvars
# Requiredto = "user@example.com"from = "other.user@example.com"
# Optionalhn_story_count = 10