{"id":13747441,"url":"https://github.com/avinashbot/redd","last_synced_at":"2025-04-04T07:06:51.129Z","repository":{"id":19184141,"uuid":"22416886","full_name":"avinashbot/redd","owner":"avinashbot","description":"Redd is a batteries-included API wrapper for reddit.","archived":false,"fork":false,"pushed_at":"2023-05-12T19:14:53.000Z","size":1628,"stargazers_count":186,"open_issues_count":35,"forks_count":75,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-30T03:43:05.414Z","etag":null,"topics":["api-wrapper","bot","oauth2","reddit","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avinashbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-07-30T08:17:44.000Z","updated_at":"2024-05-12T16:41:44.000Z","dependencies_parsed_at":"2023-10-20T17:59:01.711Z","dependency_job_id":"9b27fea3-348b-4131-912e-24dba9ea8a82","html_url":"https://github.com/avinashbot/redd","commit_stats":{"total_commits":138,"total_committers":6,"mean_commits":23.0,"dds":"0.37681159420289856","last_synced_commit":"3b1519a2d121efd18de59b935da6e652757eee90"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Fredd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Fredd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Fredd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashbot%2Fredd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avinashbot","download_url":"https://codeload.github.com/avinashbot/redd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","bot","oauth2","reddit","ruby"],"created_at":"2024-08-03T06:01:29.133Z","updated_at":"2025-04-04T07:06:51.110Z","avatar_url":"https://github.com/avinashbot.png","language":"Ruby","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003c!-- Redd --\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/avinashbot/redd/master/logo.png\" width=\"500\"\u003e\u003cbr\u003e\n    \u003c!-- Badges --\u003e\n    \u003ca href=\"https://rubygems.org/gems/redd\"\u003e\n      \u003cimg src=\"http://img.shields.io/gem/v/redd.svg?style=flat-square\" alt=\"Gem Version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/avinashbot/redd\"\u003e\n      \u003cimg src=\"http://img.shields.io/travis/avinashbot/redd.svg?style=flat-square\" alt=\"Build Status\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://rubygems.org/gems/redd\"\u003e\n      \u003cimg src=\"http://img.shields.io/gem/dt/redd.svg?style=flat-square\" alt=\"Gem Downloads\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n  \u003c!-- Intro Text --\u003e\n  \u003cp\u003e\n    \u003cstrong\u003eRedd\u003c/strong\u003e is a \u003cstrong\u003ebatteries-included\u003c/strong\u003e\n    API wrapper for \u003ca href=\"https://www.reddit.com/dev/api\"\u003ereddit\u003c/a\u003e.\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n### Features\n\n- Supports most of the reddit API, including live threads and the beta mod-mail.\n- Includes support for streaming new posts and comments.\n- Built-in rate limiting and error handling.\n- Automatic retrying of failed requests.\n\n### Demo\n\n#### Reddit Bot\n\n```ruby\nrequire 'redd'\n\nsession = Redd.it(\n  user_agent: 'Redd:RandomBot:v1.0.0 (by /u/Mustermind)',\n  client_id:  'PQgS0UaX9l70oQ',\n  secret:     'PsF_kVZrW8nSVCG5kNsIgl-AaXE',\n  username:   'RandomBot',\n  password:   'hunter2'\n)\n\nsession.subreddit('all').comments.stream do |comment|\n  if comment.body.include?('roll a dice')\n    comment.reply(\"It's a #{rand(1..6)}!\")\n  elsif comment.body.include?('flip a coin')\n    comment.reply(\"It's a #{%w(heads tails).sample}!\")\n  end\nend\n```\n\n#### Web Application\n\n```ruby\nrequire 'sinatra'\nrequire 'redd/middleware'\n\nuse Rack::Session::Cookie\nuse Redd::Middleware,\n    user_agent:   'Redd:Username App:v1.0.0 (by /u/Mustermind)',\n    client_id:    'PQgS0UaX9l70oQ',\n    secret:       'PsF_kVZrW8nSVCG5kNsIgl-AaXE',\n    redirect_uri: 'http://localhost:4567/auth/reddit/callback',\n    scope:        %w(identity),\n    via:          '/auth/reddit'\n\nget '/' do\n  reddit = request.env['redd.session']\n\n  if reddit\n    \"Hello /u/#{reddit.me.name}! \u003ca href='/logout'\u003eLogout\u003c/a\u003e\"\n  else\n    \"\u003ca href='/auth/reddit'\u003eSign in with reddit\u003c/a\u003e\"\n  end\nend\n\nget '/auth/reddit/callback' do\n  redirect to('/') unless request.env['redd.error']\n  \"Error: #{request.env['redd.error'].message} (\u003ca href='/'\u003eBack\u003c/a\u003e)\"\nend\n\nget '/logout' do\n  request.env['redd.session'] = nil\n  redirect to('/')\nend\n```\n\n### FAQ\n\n#### Are those examples fully functional?\n**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).\n\n#### Where can I find the documentation?\n\n[**Gem**](http://www.rubydoc.info/gems/redd/Redd/Models/Session) / [**GitHub**](http://www.rubydoc.info/github/avinashbot/redd/master/Redd/Models/Session)\n\n#### Where can I ask for help if I'm having issues?\nCheck out the [**official subreddit**](https://www.reddit.com/r/Redd) or raise a [**GitHub issue**](https://github.com/avinashbot/redd/issues/new).\n\n#### How do I request a feature / contribute?\nTake a look at  [**CONTRIBUTING.md**](https://github.com/avinashbot/redd/blob/master/CONTRIBUTING.md).\n\n#### How can I contact you?\n[Reddit](https://www.reddit.com/message/compose/?to=Mustermind) /\n[Email](mailto:avinash@dwarapu.me)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- Copyright Notice --\u003e\n  \u003cem\u003e\n  This project is available under the MIT License. See LICENSE.txt for more details.\u003cbr\u003e\n  The Redd logo uses the FARRAY font by Coquet Adrien.\n  \u003c/em\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinashbot%2Fredd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinashbot%2Fredd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinashbot%2Fredd/lists"}