
Security News
Oxlint Introduces Type-Aware Linting Preview
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
faraday_middleware-reddit
Advanced tools
A collection of Faraday middleware for use with the Reddit API.
This project is the backbone for reddit-base. If you're building a client from scratch or just want to get up and running quickly you might want to check it out instead.
Add this line to your application's Gemfile:
gem 'faraday_middleware-reddit'
And then execute:
$ bundle
Or install it yourself as:
$ gem install faraday_middleware-reddit
faraday
and faraday_middleware
are currently gemspec dependencies.
Like faraday_middleware
, faraday_middleware-reddit
requires a json
library. Ruby versions prior to 1.9 will need to have one installed.
faraday_middleware-reddit
currently provides the following middleware:
Middleware | Type | Description |
---|---|---|
:reddit_authentication | request | Authentication based on a username, password or pre-generated cookie. |
:reddit_force_json | use | Coerces reddit into returnign JSON for GET and POST requests. |
:reddit_modhash | use | Automatic modhash handling. |
:reddit_raise_error | response | Raises errors for common reddit error cases. |
:reddit_rate_limit | use | Rate limiting based on reddit's x-ratelimit headers. Accepts a strategy proc to override default linear strategy. |
An example Farday client might look like:
require 'faraday_middleware/reddit'
conn = Faraday.new(url: 'http://www.reddit.com', headers: {'User-Agent' => 'faraday_middleware-reddit example (v 0.0.1)'}) do |faraday|
faraday.request :url_encoded
faraday.request :reddit_authentication, user: 'yourusername', password: 'yourpassword'
faraday.request :retry, max: 2, interval: 2, exceptions: FaradayMiddleware::Reddit::RETRIABLE_ERRORS
faraday.response :logger
faraday.response :follow_redirects
faraday.response :reddit_raise_error
faraday.use :reddit_force_json
faraday.use :reddit_rate_limit
faraday.use :reddit_modhash
faraday.adapter Faraday.default_adapter
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)This project is copyright 2014 by its contributors, licensed under Apache License 2.0.
FAQs
Unknown package
We found that faraday_middleware-reddit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.