# Youtube Onebox revisited

**URL:** <https://meta.discourse.org/t/youtube-onebox-revisited/22764>\
**Category:** Feature\
**Created:** [Dezembro 2, 2014, 9:37pm UTC](https://meta.discourse.org/t/youtube-onebox-revisited/22764 "2014-12-02T21:37:43Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [Dezembro 3, 2014, 9:24am UTC](https://meta.discourse.org/t/youtube-onebox-revisited/22764/14 "2014-12-03T09:24:50Z")

</div>

> [@sperok](#):
>
> Having never created a PR and being a complete novice with Ruby I’ll probably screw something up. You are forewarned.

Go for it. a custom onebox is a good place to start i.e.

- Save a file whatever\_name\_onebox.rb in the lib/onebox/engine folder

```plaintext
module Onebox
  module Engine
    class WhateverNameOnebox
      include Engine
 
      matches_regexp /^http:\/\/www\.domian\.com\/forums\/.*/
 
      def to_html
        "<iframe src='#{@url}' style='border-width:0' frameborder='0' scrolling='no' width='100%'></iframe>"
      end
    end
  end
end

```

Regex might be tricky, and I hope you have better design skills than I do, but this will hopefully give you a starting point.

\* my iframe line is a single but it got crunched here.

---

_[View the full topic](https://meta.discourse.org/t/youtube-onebox-revisited/22764)._
