Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/KRI55H/RedditSaver

Reddit post saving library
https://github.com/KRI55H/RedditSaver

2024 reddit reddit-downloader reddit-post reddit-saver reddit-video reddit-video-downloader

Last synced: 4 months ago
JSON representation

Reddit post saving library

Awesome Lists containing this project

README

        

Reddit Saver

![Packagist Version](https://img.shields.io/packagist/v/kri55h/redditsaver.svg)
![Latest Version](https://img.shields.io/github/v/release/kri55h/redditsaver)
![Packagist Downloads](https://img.shields.io/packagist/dt/kri55h/redditsaver)
![PHP Version](https://img.shields.io/badge/PHP-^8.0-mediumslateblue)
![License](https://img.shields.io/github/license/KRI55H/RedditSaver)

### Installation

To install this package, follow these steps:
```bash
composer require kri55h/redditsaver
```
## Usage
Here's an example demonstrating how to use the `RedditSaver` class from this package:
```php
use kri55h\redditsaver\RedditSaver;

try {
$reddit = new RedditSaver();
$reddit->setPostURL('');
$videoSaved = $reddit->saveVIDEO();

if ($videoSaved) {
// Video saved successfully
return 'Video saved!';
} else {
// Handle if video saving failed
return 'Failed to save video.';
}
} catch (Exception $e) {
// Handle any exceptions or errors that occurred during the process
return 'An error occurred: ' . $e->getMessage();
}
```
Replace `` with the actual URL of the Reddit post you want to save as a video.