Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ni5arga/reddit-reader

A simple python script to get reddit post links in terminal.
https://github.com/ni5arga/reddit-reader

python python3 reddit reddit-api

Last synced: 16 days ago
JSON representation

A simple python script to get reddit post links in terminal.

Awesome Lists containing this project

README

        

# Reddit Reader Script
This script retrieves the top posts from a specified subreddit using the Reddit JSON API. It allows you to specify the subreddit, time filter, and sort method (hot, top, new, rising) as command-line arguments.

## Prerequisites

- Python 3.x
- `requests` library

## Installation

1. Clone the repository or download the `reddit.py` file.
2. Install the `requests` library by running the following command: `pip install requests`

## Usage

Run the script using the following command:
`python reddit.py `

Replace ``, ``, and `` with the desired values:

- ``: The name of the subreddit you want to retrieve top posts from.
- ``: The time filter for the top posts. Valid options are `day`, `week`, `month`, `year`, or `all`.
- ``: The sorting method for the top posts. Valid options are `hot`, `top`, `new`, or `rising`.

Example: `python reddit.py science day top`