Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ni5arga/reddit-reader
- Owner: ni5arga
- License: mit
- Created: 2023-11-13T09:18:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-13T09:24:35.000Z (about 1 year ago)
- Last Synced: 2024-11-07T12:26:10.436Z (2 months ago)
- Topics: python, python3, reddit, reddit-api
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`