hackernews_dashboard_ask_and_show_by_hourhackernews_dashboard_ask_counthackernews_dashboard_avg_ask_scorehackernews_dashboard_avg_scorehackernews_dashboard_avg_show_scorehackernews_dashboard_max_scorehackernews_dashboard_mentionshackernews_dashboard_show_counthackernews_dashboard_stories_by_hourhackernews_dashboard_user_with_greater_than_50_scorehackernews_dashboard_user_with_greater_than_5_posthackernews_jobs_by_dayshackernews_jobs_by_technologyhackernews_jobs_by_typehackernews_jobs_searchhackernews_sources_detailhackernews_sources_domain_inputhackernews_sources_domainshackernews_sources_top_10_domains_by_counthackernews_sources_top_10_domains_by_max_scorehackernews_stories_avg_commentshackernews_stories_detailshackernews_stories_max_comments
Query: hackernews_dashboard_mentions
Usage
powerpipe query hackernews_insights.query.hackernews_dashboard_mentions
Steampipe Tables
SQL
with data as ( ( select * from hackernews_new where $1 = 'New' ) union ( select * from hackernews_top where $1 = 'Top' ) union ( select * from hackernews_best where $1 = 'Best' )),names as ( select unnest($2 :: text [ ]) as name),counts as ( select name, ( select count(*) from data where title ~* name and ( extract( epoch from now() - time :: timestamptz ) / 60 ) :: int between symmetric $3 and $4 ) as mentions from names)select replace( name, '\', '') as name, mentionsfrom countswhere mentions > 0order by mentions desc
Params
Args | Name | Default | Description | Variable |
---|---|---|---|---|
$1 | story_type | |||
$2 | names | |||
$3 | min_minutes_ago | |||
$4 | max_minutes_ago |
Dashboards
The query is used in the dashboards: