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_itemwhere type = 'story';
select *from hackernews_itemwhere 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_itemwhere type = 'story' and score > 5order by score desc;
select *from hackernews_itemwhere type = 'story' and score > 5order 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_itemwhere type = 'story' and kids is null;
select *from hackernews_itemwhere 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_itemgroup by byhaving count(*) > 5order by count desc;
select by, count(*)from hackernews_itemgroup by byhaving count(*) > 5order by count(*) desc;
Schema for hackernews_item
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
by | text | The username of the item's author. | |
dead | boolean | True if the item is dead. | |
deleted | boolean | True if the item is deleted. | |
descendants | bigint | In the case of stories or polls, the total comment count. | |
id | bigint | = | The item's unique id. |
kids | jsonb | The ids of the item's comments, in ranked display order. | |
parent | bigint | The comment's parent: either another comment or the relevant story. | |
parts | jsonb | A list of related pollopts, in display order. | |
poll | bigint | The pollopt's associated poll. | |
score | bigint | The story's score, or the votes for a pollopt. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
text | text | The comment, story or poll text. HTML. | |
time | timestamp with time zone | Timestamp when the item was created. | |
title | text | The title of the story, poll or job. HTML. | |
type | text | The type of item. One of "job", "story", "comment", "poll", or "pollopt". | |
url | text | The 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