All Projects → avinashbot → Redd

avinashbot / Redd

Licence: mit
Redd is a batteries-included API wrapper for reddit.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Redd

Psraw
PowerShell Reddit API Wrapper
Stars: ✭ 42 (-76.67%)
Mutual labels:  api-wrapper, oauth2, reddit
Igbot
🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
Stars: ✭ 4,094 (+2174.44%)
Mutual labels:  api-wrapper, bot
Reddit Video Download Bot
A reddit bot that provides downloadable video links
Stars: ✭ 301 (+67.22%)
Mutual labels:  bot, reddit
Pizzly
The simplest, fastest way to integrate your app with an OAuth API 😋
Stars: ✭ 796 (+342.22%)
Mutual labels:  api-wrapper, oauth2
Graw
Golang Reddit API Wrapper
Stars: ✭ 251 (+39.44%)
Mutual labels:  bot, reddit
SoundCloud-API
SoundCloud API wrapped into a bunch of classes. Built with Retrofit2 and RxJava2.
Stars: ✭ 63 (-65%)
Mutual labels:  oauth2, api-wrapper
roux
Simple and (a)synchronous Reddit API wrapper for Rust.
Stars: ✭ 41 (-77.22%)
Mutual labels:  reddit, api-wrapper
Spam Bot 3000
Social media research and promotion, semi-autonomous CLI bot
Stars: ✭ 79 (-56.11%)
Mutual labels:  bot, reddit
Botauth
Authentication middleware for the botframework
Stars: ✭ 74 (-58.89%)
Mutual labels:  bot, oauth2
Psmsgraph
A PowerShell module for the Microsoft Graph API
Stars: ✭ 71 (-60.56%)
Mutual labels:  api-wrapper, oauth2
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+86.67%)
Mutual labels:  oauth2, reddit
Reddit Anti Gif Bot
A Reddit bot providing an mp4 link/mirror for gif submissions
Stars: ✭ 138 (-23.33%)
Mutual labels:  bot, reddit
Netcore Postgres Oauth Boiler
A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and NGINX for routing.
Stars: ✭ 57 (-68.33%)
Mutual labels:  oauth2, reddit
Imguralbumbot
A reddit bot for linking direct images of single-picture albums
Stars: ✭ 107 (-40.56%)
Mutual labels:  bot, reddit
Jda
Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Stars: ✭ 2,598 (+1343.33%)
Mutual labels:  api-wrapper, bot
Protonmail Account Creator
🚀 Create hundreds of free ProtonMail Email Accounts in the matter of minutes 🚀
Stars: ✭ 173 (-3.89%)
Mutual labels:  bot
Discord.ts
🤖 Create your discord bot by using TypeScript and decorators!
Stars: ✭ 172 (-4.44%)
Mutual labels:  bot
Mumbledj
A Mumble bot that plays audio fetched from various media sites.
Stars: ✭ 172 (-4.44%)
Mutual labels:  bot
Csgofloat Inspect
Source Code that Powers the CSGOFloat Inspect Link API
Stars: ✭ 172 (-4.44%)
Mutual labels:  bot
Hanhandespider
🕷一个Node.js图片爬虫程序,使用async并发控制库,async await语法
Stars: ✭ 178 (-1.11%)
Mutual labels:  bot


Gem Version Build Status Gem Downloads

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?

Gem / GitHub

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?

Reddit / Email


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 the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].