Skip to content

matchu/reddit-countdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reddit Countdown

This is a pretty basic attempt to implement a countdown in a subreddit's sidebar to help Reddit communities count down to important events.

Quick Start

First, set up Python 2.7 and the pip package manager if you haven't already, then install our lone dependency: praw, the Python Reddit API Wrapper.

pip install praw

Next, create a countdown.cfg file based on the provided countdown.cfg.sample. I'd recommend making a new bot account and granting it mod access to the subreddit you'd like to count down in.

Finally, now that the script is ready to run, update your subreddit's sidebar to contain countdown placeholders:

There are [some](#days) days, [some](#hours) hours, [some](#minutes)
minutes, and [some](#seconds) seconds remaining.

Run the script and, assuming all goes well, it will automatically fill in the blanks and save its changes.

python countdown.py

Since the countdown placeholders are implemented as links, you might want to restyle them in your subreddit's CSS:

a[href="#days"], a[href="#hours"], a[href="#minutes"], a[href="#seconds"] {
    color: inherit;
    cursor: text;
}

Ta da! You can style all that however you like and set up your computer to run at regular intervals or whatever you like.

About

Automatically update a countdown in a subreddit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages