Last active
August 20, 2016 11:27
-
-
Save Udo/c9f2187d0a97773cff16842ed37512a8 to your computer and use it in GitHub Desktop.
Tampermonkey script for displaying the Ludum Dare Streamers widget on the LD website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Ludum Dare Streamers Widget | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Simple script to patch a live stream preview into the Ludum Dare website. | |
// @author Udo Schroeter udo.schroeter@gmail.com | |
// @grant none | |
// @include http://ludumdare.com/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var injectLinkIntoSidebar = function() { | |
jQuery('.imagebox').append('<div>'+ | |
'<img src="http://direct.openfu.com/ld/live/img/playbutton.png" width="56" />'+ | |
'<div>'+ | |
'<div class="headline">Streaming Ludum Dare</div>'+ | |
'<div>Programming live streams</div>'+ | |
'</div>'+ | |
'<a href="https://openfu.com/ld/live"><img src="/_.png" class="blank" /></a>'+ | |
'</div>'); | |
}; | |
var injectPreview = function() { | |
jQuery('.imagebox').prepend('<iframe '+ | |
'style="border: none; border-radius: 12px;" '+ | |
'src="https://openfu.com/ld/live/?preview-widget" '+ | |
'width="100%" height="180"></iframe>'); | |
}; | |
if(jQuery && jQuery('.imagebox').length > 0) { | |
// injectLinkIntoSidebar(); | |
injectPreview(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment