Description
redd is an API wrapper for reddit written in ruby that focuses on being consistent and extensible.
redd alternatives and similar gems
Based on the "Third-party APIs" category.
Alternatively, view redd alternatives based on common mentions on social networks and blogs.
-
ruby-gmail
A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages. -
itunes_store_transporter
Upload and manage your assets in the iTunes Store using the iTunes Store’s Transporter (iTMSTransporter). -
pivotal-tracker-api
This is a Ruby Gem that can be used to communicate with the Pivotal Tracker API v5
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of redd or a related project?
Popular Comparisons
README
<!-- Redd --> <!-- Badges --> <!-- Intro Text --> Redd is a batteries-included API wrapper for reddit.
Features
- Supports most of the reddit API, including live threads and the beta mod-mail.
- Includes support for streaming new posts and comments.
- Built-in rate limiting and error handling.
- Automatic retrying of failed requests.
Demo
Reddit Bot
require 'redd'
session = Redd.it(
user_agent: 'Redd:RandomBot:v1.0.0 (by /u/Mustermind)',
client_id: 'PQgS0UaX9l70oQ',
secret: 'PsF_kVZrW8nSVCG5kNsIgl-AaXE',
username: 'RandomBot',
password: 'hunter2'
)
session.subreddit('all').comments.stream do |comment|
if comment.body.include?('roll a dice')
comment.reply("It's a #{rand(1..6)}!")
elsif comment.body.include?('flip a coin')
comment.reply("It's a #{%w(heads tails).sample}!")
end
end
Web Application
require 'sinatra'
require 'redd/middleware'
use Rack::Session::Cookie
use Redd::Middleware,
user_agent: 'Redd:Username App:v1.0.0 (by /u/Mustermind)',
client_id: 'PQgS0UaX9l70oQ',
secret: 'PsF_kVZrW8nSVCG5kNsIgl-AaXE',
redirect_uri: 'http://localhost:4567/auth/reddit/callback',
scope: %w(identity),
via: '/auth/reddit'
get '/' do
reddit = request.env['redd.session']
if reddit
"Hello /u/#{reddit.me.name}! <a href='/logout'>Logout</a>"
else
"<a href='/auth/reddit'>Sign in with reddit</a>"
end
end
get '/auth/reddit/callback' do
redirect to('/') unless request.env['redd.error']
"Error: #{request.env['redd.error'].message} (<a href='/'>Back</a>)"
end
get '/logout' do
request.env['redd.session'] = nil
redirect to('/')
end
FAQ
Are those examples fully functional?
Yes, that's all there is to it! You don't need to handle rate-limiting, refresh access tokens or protect against issues on reddit's end (like 5xx errors).
Where can I find the documentation?
Where can I ask for help if I'm having issues?
Check out the official subreddit or raise a GitHub issue.
How do I request a feature / contribute?
Take a look at CONTRIBUTING.md.
How can I contact you?
<!-- Copyright Notice --> This project is available under the MIT License. See LICENSE.txt for more details. The Redd logo uses the FARRAY font by Coquet Adrien.
*Note that all licence references and agreements mentioned in the redd README section above
are relevant to that project's source code only.