Skip to content

Instantly share code, notes, and snippets.

@Udo
Last active August 20, 2016 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Udo/c9f2187d0a97773cff16842ed37512a8 to your computer and use it in GitHub Desktop.
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
// ==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