Revert "twitch.tv URLs appear to be banned from 4chan, no point in maintaining this code"

This reverts commit 6002d118d6fe6cf21955a1ed16d56d2eaad40471.
This commit is contained in:
ccd0 2014-05-09 17:29:12 -07:00
parent 26e66b0b2f
commit 90149c3b9c

View File

@ -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: """
<param name='allowFullScreen' value='true' />
<param name='flashvars' value='channel=#{channel}&start_volume=25&auto_play=false#{if chapter then "&chapter_id=" + chapter else ""}' />
"""
else
channel = (/(\w+)/.exec a.dataset.uid)[0]
$.el 'object',
data: "http://www.twitch.tv/widgets/live_embed_player.swf?channel=#{channel}"
innerHTML: """
<param name="allowFullScreen" value="true" />
<param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
<param name="flashvars" value="hostname=www.twitch.tv&channel=#{channel}&auto_play=true&start_volume=25" />
"""
,
key: 'Vocaroo'
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/