gitwtfhub

wtf is onebox?

discourse/onebox — explained in plain English

Analysis updated 2026-07-28 · repo last pushed 2024-02-01

791RubyAudience · developerComplexity · 2/5DormantSetup · moderate

TL;DR

Onebox is a Ruby library that turns plain URLs into rich visual previews like embedded videos, images, and article summaries. Originally built for Discourse forums, it works in any Ruby app but is now deprecated and moved into the main Discourse repo.

Mindmap

mindmap
  root((repo))
    What it does
      URL to preview
      HTML snippets
      Videos and images
    Tech stack
      Ruby library
      Open Graph
      oEmbed standard
    Use cases
      Forums and chat
      Social platforms
      Blogging tools
    Audience
      Web app builders
      Community site owners
      Ruby developers
    Status
      Deprecated standalone
      Moved to Discourse
      Dev server included

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Add automatic link previews to a forum or community site where users share articles and videos.

REASON 2

Embed YouTube videos and Amazon product previews in a chat application without writing custom logic.

REASON 3

Build a blogging tool that automatically expands pasted links into rich visual cards.

What's in the stack?

RubyOpen GraphoEmbed

How it stacks up

discourse/oneboxrails/solid_cachesds/mock_redis
Stars7911,019505
LanguageRubyRubyRuby
Last pushed2024-02-012026-06-22
MaintenanceDormantMaintained
Setup difficultymoderateeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

This standalone gem is deprecated and unmaintained, users should use the version in the main Discourse repository instead.

No license information is provided in the explanation, so the licensing terms are unknown.

Wtf does this do

Onebox is a Ruby library that converts plain URLs into rich, visual previews. You know how when you paste a link into a chat or forum and it automatically expands into an embedded video player, image, or article preview? That's exactly what this does. It was originally built for the Discourse forum platform but was extracted into a standalone library so any Ruby application could use it. At a high level, you hand it a URL and it returns an HTML snippet with the relevant preview content. For example, a YouTube link becomes an embedded video player, and an Amazon product link becomes a preview with the product image, name, and description. It supports many popular sites out of the box and can handle pages, images, and videos. For sites that follow common web standards for embedding content (like Open Graph or oEmbed), it can often generate previews automatically. For sites that don't, developers can write custom "engines" to handle the transformation. This would be useful for anyone building a web application where users share links and you want those links to look good automatically. Forum software, social platforms, chat applications, or blogging tools could all benefit. If you're running a community site where members post links to articles, videos, or products, this saves you from building that preview logic yourself. One important note: this standalone version is deprecated and no longer maintained. The code has moved into the main Discourse repository, so anyone looking to use or contribute to it today should go there instead. The README also includes a development server so you can test how different URLs will render before integrating it into a project.

Yoink these prompts

Prompt 1
Help me set up the Discourse Onebox gem in my Ruby on Rails app so that pasted URLs automatically expand into rich previews with embedded videos and images.
Prompt 2
Write a custom Onebox engine for a specific website that does not support Open Graph or oEmbed, following the pattern used by existing engines in the Onebox gem.
Prompt 3
Set up the Onebox development server so I can test how different URLs render as previews before integrating the gem into my project.
Prompt 4
Migrate my application from using the standalone discourse-onebox gem to pulling Onebox from the main Discourse repository since the standalone version is deprecated.

Frequently asked questions

wtf is onebox?

Onebox is a Ruby library that turns plain URLs into rich visual previews like embedded videos, images, and article summaries. Originally built for Discourse forums, it works in any Ruby app but is now deprecated and moved into the main Discourse repo.

What language is onebox written in?

Mainly Ruby. The stack also includes Ruby, Open Graph, oEmbed.

Is onebox actively maintained?

Dormant — no commits in 2+ years (last push 2024-02-01).

What license does onebox use?

No license information is provided in the explanation, so the licensing terms are unknown.

How hard is onebox to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is onebox for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.