From 90149c3b9c0d5e09b8a12b2b165e8bfd7c49d376 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 9 May 2014 17:29:12 -0700 Subject: [PATCH] Revert "twitch.tv URLs appear to be banned from 4chan, no point in maintaining this code" This reverts commit 6002d118d6fe6cf21955a1ed16d56d2eaad40471. --- src/Linkification/Linkify.coffee | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 204ce9fa5..591f13173 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -342,6 +342,31 @@ Linkify = el: (a) -> $.el 'iframe', src: "http://strawpoll.me/embed_1/#{a.dataset.uid}" + , + key: 'TwitchTV' + regExp: /.*(?:twitch.tv\/)([^#\&\?]*).*/ + style: "border: none; width: 640px; height: 360px;" + el: (a) -> + if result = /(\w+)\/(?:[a-z]\/)?(\d+)/i.exec a.dataset.uid + [_, channel, chapter] = result + + $.el 'object', + data: 'http://www.twitch.tv/widgets/archive_embed_player.swf' + innerHTML: """ + + +""" + + else + channel = (/(\w+)/.exec a.dataset.uid)[0] + + $.el 'object', + data: "http://www.twitch.tv/widgets/live_embed_player.swf?channel=#{channel}" + innerHTML: """ + + + +""" , key: 'Vocaroo' regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/