turbot/hackernews
steampipe plugin install hackernews

Table: hackernews_item - Query Hacker News Items using SQL

Hacker News is a social news website focusing on computer science and entrepreneurship. It is run by investment fund and startup incubator, Y Combinator. In essence, it's a social news aggregation site that primarily concentrates on information technology and startups.

Table Usage Guide

The hackernews_item table provides insights into the items posted on Hacker News. As a data analyst or a researcher, explore item-specific details through this table, including the type of post, author, score, and associated metadata. Utilize it to uncover information about the most popular or controversial posts, the frequency of posts by specific authors, or trends in the topics being discussed.

Important Notes

  • max_items in the connection configuration defines the number of items returned by a list query to this table.

Examples

List recent items

Explore the latest items in HackerNews to stay updated with the most recent discussions, stories, and comments. This is useful for those who want to keep up with the latest trends and topics in the technology and startup space.

select
*
from
hackernews_item;
select
*
from
hackernews_item;

List all recent stories

Explore the recent narratives shared on Hackernews to stay updated with the latest discussions and trends. This can be useful to monitor popular topics and engage with the community effectively.

select
*
from
hackernews_item
where
type = 'story';
select
*
from
hackernews_item
where
type = 'story';

Recent stories with score > 5

Discover the segments that consist of popular stories on HackerNews. This can be useful to identify trending topics or high-interest areas, helping to guide your content strategy or research focus.

select
*
from
hackernews_item
where
type = 'story'
and score > 5
order by
score desc;
select
*
from
hackernews_item
where
type = 'story'
and score > 5
order by
score desc;

Recent stories with no comments

Explore the recent posts on Hacker News that have not received any comments. This can help identify under-discussed topics and potentially overlooked content.

select
*
from
hackernews_item
where
type = 'story'
and kids is null;
select
*
from
hackernews_item
where
type = 'story'
and kids is null;

Which users have made more than 5 submissions recently

Explore which users have been particularly active by identifying those who have made more than five submissions recently. This can be useful for understanding user engagement and identifying key contributors or influencers within your community.

select
by,
count(*)
from
hackernews_item
group by
by
having
count(*) > 5
order by
count desc;
select
by,
count(*)
from
hackernews_item
group by
by
having
count(*) > 5
order by
count(*) desc;

Schema for hackernews_item

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
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.
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_item