Provides a .NET client for interacting with reddit.
The client was designed with the following goals in mind:
- Simple, modern, asynchronous API
- Support for various authentication modes
- Modular structure with simple re-usable components
var builder = RedditClientBuilder.New;
// Configure builder
...
var client = await builder.BuildAsync();
// Get the details of a subreddit
var askReddit = client.Subreddit("askreddit");
var askRedditDetails = await askReddit.GetDetailsAsync();
// Get the top 50 hot submissions
var topFiftyHotSubmissions = askReddit.GetSubmissionsAsync(builder =>
builder
.WithSort(SubredditSubmissionSort.Hot)
.WithMaximumItems(50));
await foreach (var submission in topFiftyHotSubmissions)
{
// Upvote the submission
await submission
.Interact(client)
.UpvoteAsync();
}
Further examples of usage can be found in the demos folder.
Following the instructions below to get started with the project in a local development environment.
After cloning the source code to a destination of your choice, run the following command to build the solution:
dotnet build
The test suite can be run using the following command:
dotnet test
See the docs folder for documentation on how to use the client and an overview of its internals.
The documentation is also hosted on GitHub pages.