Download the PHP package tatter/reddit without Composer

On this page you can find all versions of the php package tatter/reddit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package reddit

codeigniter4-reddit

Reddit SDK for CodeIgniter 4

Quick Start

  1. Install with Composer: > composer require tatter/reddit
  2. Supply Reddit credentials in .env
  3. Get API results:

Description

Reddit SDK provides a framework-ready wrapper to the API endpoints describe in the Reddit API documentation.

Configuration (optional)

The library's default behavior can be altered by extending its config file. Copy examples/Reddit.php to app/Config/ and follow the instructions in the comments. If no config file is found in app/Config then the library will use its own.

Credentials

This library requires a valid Reddit application to acquire access tokens that work with API. For more details read the Reddit OAuth2 wiki.

  1. Login to Reddit and visit the "authorized applications" page (https://www.reddit.com/prefs/apps/)
  2. Under "developed applications" select "create an app..."
  3. Select "script" as the application type
  4. Provide a name, description, and URLs in the required text fields
  5. Select "create app"

Once your application is created you will need to copy the "client ID" and "secret" (see the wiki article above for help). Add these along with your username and password into your project's .env file, for example:

Usage

The easiest way to access the client is via the CodeIgniter's Services:

$reddit = service('reddit');

The client will handle authentication (assuming your credentials are valid), rate limiting, response filtering and formatting. Access client methods in chains to set up the request, then use fetch() to kick it off:

$comments = $reddit->subreddit('catgifs')->limit(10)->fetch('comments');

For more advanced needs you may use the request($uri, $data, $query) method which returns the actual Response object, providing access to headers, etc. See also HTTP/RedditRequest.php and HTTP/RedditResponse.php for some of the API handling done "under the hood".

Troubleshooting

Should something go wrong all anticipated exceptions are wrapped in Tatter\Reddit\Exceptions\RedditException, so you can catch them and figure out what happened:


All versions of reddit with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tatter/reddit contains the following files

Loading the files please wait ....