turbot/hackernews
steampipe plugin install hackernews

Table: hackernews_top - Query Hacker News Top Stories using SQL

Hacker News is a social news website focusing on computer science and entrepreneurship. It is run by Paul Graham's investment fund and startup incubator, Y Combinator. In general, content that can be submitted is defined as "anything that gratifies one's intellectual curiosity".

Table Usage Guide

The hackernews_top table provides insights into the most popular posts within Hacker News. As a data analyst or a content strategist, explore post-specific details through this table, including post title, author, and score. Utilize it to uncover information about trending topics, popular authors, and the overall user engagement in the platform.

Examples

Top stories by score

Discover the most popular stories on HackerNews by assessing their score. This allows you to identify trending topics and understand what content resonates most with the community.

select
*
from
hackernews_top
order by
score desc;
select
*
from
hackernews_top
order by
score desc;

Top stories with most comments

Discover the most discussed topics on Hackernews. This query helps you identify the stories that are generating the most conversation, enabling you to stay informed about trending topics.

select
*
from
hackernews_top
order by
descendants desc;
select
*
from
hackernews_top
order by
descendants desc;

Schema for hackernews_top

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
bytextThe username of the item's author.
deadbooleanTrue if the item is dead.
deletedbooleanTrue if the item is deleted.
descendantsbigintIn the case of stories or polls, the total comment count.
idbigint=The item's unique id.
kidsjsonbThe ids of the item's comments, in ranked display order.
parentbigintThe comment's parent: either another comment or the relevant story.
partsjsonbA list of related pollopts, in display order.
pollbigintThe pollopt's associated poll.
scorebigintThe story's score, or the votes for a pollopt.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
texttextThe comment, story or poll text. HTML.
timetimestamp with time zoneTimestamp when the item was created.
titletextThe title of the story, poll or job. HTML.
typetextThe type of item. One of "job", "story", "comment", "poll", or "pollopt".
urltextThe URL of the story.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hackernews

You can pass the configuration to the command with the --config argument:

steampipe_export_hackernews --config '<your_config>' hackernews_top