Table: reddit_my_post - Query Reddit Posts using SQL
Reddit is a network of communities based on people's interests. It allows users to post content, including text posts, links, and images, which are then voted up or down by other members. Posts are organized by subject into user-created boards called "subreddits", which cover a variety of topics like news, science, movies, video games, music, books, fitness, food, and image-sharing.
Table Usage Guide
The reddit_my_post
table provides insights into a user's posts on Reddit. As a data analyst or social media manager, explore post-specific details through this table, including post title, content, subreddit, upvotes, and more. Utilize it to uncover information about user's post activity, engagement, and the popularity of posts across different subreddits.
Examples
5 most recent posts
Discover the latest updates or additions to your Reddit posts. This query can be used to keep track of your most recent posts, helping you to maintain an active and timely presence on the platform.
select created_utc, title, urlfrom reddit_my_postorder by created_utc desclimit 5;
select created_utc, title, urlfrom reddit_my_postorder by created_utc desclimit 5;
Top 5 posts by score
Discover the most popular posts based on their scores to understand what content resonates most with your audience. This can help you tailor future content to increase engagement and upvotes.
select score, upvote_ratio, title, urlfrom reddit_my_postorder by score desclimit 5;
select score, upvote_ratio, title, urlfrom reddit_my_postorder by score desclimit 5;
Posts by subreddit
Explore which subreddits you are most active in by counting the number of posts you have made in each. This can help you understand your Reddit usage patterns and areas of interest.
select subreddit_name_prefixed, count(*)from reddit_my_postgroup by subreddit_name_prefixedorder by count desc;
select subreddit_name_prefixed, count(*)from reddit_my_postgroup by subreddit_name_prefixedorder by count(*) desc;
Posts containing the word "docs"
Discover the segments that include the word 'docs' within your Reddit posts. This can help you analyze the frequency and context of discussions about documentation, providing insights into user engagement and potential areas of improvement.
select created_utc, title, url, selftextfrom reddit_my_postwhere selftext ilike '%docs%'order by created_utc;
select created_utc, title, url, selftextfrom reddit_my_postwhere selftext like '%docs%'order by created_utc;
Schema for reddit_my_post
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
author | text | Author of the post. | |
author_fullname | text | Full name of the author for the post. | |
created_utc | timestamp with time zone | Time when the post was created. | |
edited | timestamp with time zone | Time when the post was edited. | |
id | text | ID of the post. | |
is_self | boolean | ||
likes | boolean | True if you've upvoted the post. False if you've downvoted it. Otherwise null. | |
locked | boolean | True if the post is locked. | |
name | text | Slug (full ID) of the post. | |
num_comments | bigint | Number of comments on the post. | |
over_18 | boolean | True if the post is not safe for work (over 18). | |
permalink | text | Permalink (path only) to the post. | |
rank | bigint | Rank of the post among the result rows, use for sorting. | |
saved | boolean | True if the post has been saved. | |
score | bigint | Score of the post. | |
selftext | text | Body of the post. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
spoiler | boolean | True if the post is a spoiler. | |
stickied | boolean | True if the post has been stickied. | |
subreddit | text | Name of the subreddit, e.g. aws. | |
subreddit_id | text | ID of the subreddit. | |
subreddit_name_prefixed | text | Prefixed name of the subreddit, e.g. /r/aws. | |
subreddit_subscribers | bigint | Number of subscribers to the subreddit. | |
title | text | Title of the post. | |
upvote_ratio | double precision | Upvote ratio of the post. | |
url | text | URL the post links to, or of the post itself. | |
username | text | =, !=, ~~, ~~*, !~~, !~~* | The authorized username. |
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)" -- reddit
You can pass the configuration to the command with the --config
argument:
steampipe_export_reddit --config '<your_config>' reddit_my_post