Greasy Fork is available in English.

Streaming House Chile

SH Logo

  1. // ==UserScript==
  2. // @name Streaming House Chile
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description SH Logo
  6. // @author Snouly
  7. // @match https://hot-potato.reddit.com/embed*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
  9. // @grant none
  10. // @license GNU GPLv3
  11. // ==/UserScript==
  12.  
  13. var child = null;
  14.  
  15. function getImage() {
  16. var num = Math.random();
  17. const i = document.createElement("img");
  18. i.src = "https://i.imgur.com/nyZUVDi.png";
  19. i.style = "position: absolute;left: 0;top: 0;image-rendering: pixelated;width: 2000px;height: 1000px;";
  20. return i;
  21. }
  22.  
  23. function refreshTemplate() {
  24. var x = document.getElementsByTagName("mona-lisa-embed")[0].shadowRoot.children[0].getElementsByTagName("mona-lisa-canvas")[0].shadowRoot.children[0];
  25. if (child) {
  26. x.removeChild(child);
  27. }
  28. child = getImage();
  29. x.appendChild(child, false);
  30. console.log("Template has been updated.");
  31. }
  32.  
  33. function refreshTemplateLoop() {
  34. refreshTemplate();
  35. setTimeout(function() {
  36. refreshTemplateLoop();
  37. }, 300 * 1000);
  38. }
  39.  
  40. (function() {
  41. function addButton(text, onclick, cssObj) {
  42. cssObj = cssObj || {
  43. position: 'absolute',
  44. bottom: '7%',
  45. left: '4%',
  46. 'z-index': 3
  47. }
  48. let button = document.createElement('button'), btnStyle = button.style
  49. document.body.appendChild(button)
  50. button.innerHTML = text
  51. button.onclick = onclick
  52. btnStyle.position = 'absolute'
  53. Object.keys(cssObj).forEach(key => {
  54. btnStyle[key] = cssObj[key]
  55. })
  56. return button
  57. }
  58.  
  59. window.addEventListener('load', () => {
  60. setTimeout(function() {
  61. refreshTemplateLoop();
  62. }, 4000);
  63. addButton('Update Template', refreshTemplate)
  64. })
  65. })();