Table: reddit_my_saved_post - Query Reddit Saved Posts using SQL
Reddit is a social media platform that allows users to discuss and vote on content shared by other users. Users can save posts for later reference; these saved posts can be from any subreddit and include various details such as the post's title, author, subreddit, and more. This functionality is part of the overall user interaction with the platform, contributing to the personalized user experience.
Table Usage Guide
The reddit_my_saved_post
table provides insights into a user's saved posts within Reddit. As a data analyst, explore post-specific details through this table, including title, author, subreddit, and associated metadata. Utilize it to uncover information about saved posts, such as those from specific subreddits, posts by certain authors, and the nature of the content saved by the user. The schema presents a range of attributes of the saved post for your analysis, like the post ID, title, author, subreddit, and more.
Examples
List five most recent posts
Explore the most recent activities on your Reddit account by identifying the five latest saved posts. This can help you keep track of your recent interactions and interests.
select created_utc, title, urlfrom reddit_my_saved_postorder by created_utc desclimit 5;
select created_utc, title, urlfrom reddit_my_saved_postorder by created_utc desclimit 5;
List top five posts by score
Gain insights into the most popular posts based on their score. This query helps you identify the top five posts, offering a quick overview of the most engaging content.
select score, upvote_ratio, title, urlfrom reddit_my_saved_postorder by score desclimit 5;
select score, upvote_ratio, title, urlfrom reddit_my_saved_postorder by score desclimit 5;
List posts by subreddit
Discover the segments that garner the most engagement on your saved Reddit posts. This allows you to focus your attention on the most active subreddits, thus optimizing your Reddit usage.
select subreddit_name_prefixed, count(*)from reddit_my_saved_postgroup by subreddit_name_prefixedorder by count desc;
select subreddit_name_prefixed, count(*)from reddit_my_saved_postgroup by subreddit_name_prefixedorder by count(*) desc;
List posts that contain the word "docs"
Discover the segments that include references to "docs" in your saved posts on Reddit. This can help you quickly locate posts that mention documentation or similar topics.
select created_utc, title, url, selftextfrom reddit_my_saved_postwhere selftext ilike '%docs%'order by created_utc;
select created_utc, title, url, selftextfrom reddit_my_saved_postwhere selftext like '%docs%'order by created_utc;
Schema for reddit_my_saved_post
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
author | text | Author of the post. | |
author_id | text | Full name of the author for the post. | |
body | text | Body of the post. | |
created | timestamp with time zone | Time when the post was created. | |
edited | timestamp with time zone | Time when the post was edited. | |
full_id | text | Slug (full ID) of the post. | |
id | text | ID of the post. | |
is_self_post | 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. | |
nsfw | boolean | True if the post is not safe for work (over 18). | |
number_of_comments | bigint | Number of comments on the post. | |
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. | |
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_id | text | ID of the subreddit. | |
subreddit_name | text | Name of the subreddit, e.g. aws. | |
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_saved_post