mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 11:33:39 +08:00
16 lines
299 B
Ruby
16 lines
299 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require_relative '../mixins/twitch_onebox'
|
||
|
|
||
|
class Onebox::Engine::TwitchVideoOnebox
|
||
|
def self.twitch_regexp
|
||
|
/^https?:\/\/(?:www\.)?twitch\.tv\/videos\/([0-9]+)/
|
||
|
end
|
||
|
|
||
|
include Onebox::Mixins::TwitchOnebox
|
||
|
|
||
|
def query_params
|
||
|
"video=v#{twitch_id}"
|
||
|
end
|
||
|
end
|