Skip to content

jeanlucthumm/reddit-easy-post

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reddit-easy-post

Define your Reddit post via YAML, run this script to post it to Reddit. Ideal for scheduling using external tool.

Usage

  1. Create a YAML file with the post contents
  2. (Optional) List available flairs for target subreddit.
poetry run main --flairs <subreddit>
  1. Run the script:
poetry run main --file <post-file.yaml>

Input file format (YAML)

type: text # Only text currently supported
title: Sample Title
subreddit: test # Omit the r/ prefix
body: |
    Multi line strings in YAML start with the '|' prefix.
    Alternatively, you can use '>' instead of '|' if you don't want to preserve line breaks.
    Or you can leave this empty for no body
flair: Sample Flair # Optional. Use --flairs to get names

Scheduling

Use any of the following tools to run the script on demand:

  • at
  • cron
  • systemd timers

Environment variables

Variable Desc Required
REDDIT_USER Username Yes
REDDIT_PASS Password Yes
REDDIT_CLIENTID Reddit API Client ID Yes
REDDIT_CLIENTSEC Reddit API Client Secret Yes

See the following for how to get REDDIT_CLIENTID and REDDIT_CLIENTSEC:

https://www.reddit.com/r/redditdev/comments/hasnnc/where_do_i_find_the_reddit_client_id_and_secret

About

Easy to use YAML to Reddit posting via API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published