Skip to content

Instantly share code, notes, and snippets.

@jelmervdl
Last active March 22, 2017 16:42
Show Gist options
  • Save jelmervdl/bdef3b2bb317199066f075adc2c73dc6 to your computer and use it in GitHub Desktop.
Save jelmervdl/bdef3b2bb317199066f075adc2c73dc6 to your computer and use it in GitHub Desktop.
ibood announcer

iBOOD Hunt Announcer

Na de bel hoor je voortaan wat de volgende hunt is!

Installeren

  1. Installeer eerst de Tampermonkey plugin in Chrome.
  2. Ga daarna naar deze pagina (hey!) en klink op het 'RAW' knopje bij het script hierboven.
  3. Als het goed is opent Tampermonkey nu en installeert hij het script
  4. Ga naar http://iboodhunt.1dagskoopjes.nl/ en laat de pagina open staan. Direct na de bel hoor je wat de nieuwe hunt is :)
// ==UserScript==
// @name iboodAnnouncer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Jelmer
// @match iboodhunt.1dagskoopjes.nl/
// @grant none
// ==/UserScript==
(function() {
'use strict';
let voice = speechSynthesis.getVoices().find((voice) => voice.lang == 'nl-NL');
angular.element(document.querySelector('[ng-app]')).injector().get('mySocket').on('new deal', (deal) => {
if (deal.country == 'nl') {
let utterance = new SpeechSynthesisUtterance(deal.title);
utterance.voice = voice;
utterance.lang = 'nl-NL';
setTimeout(() => {
speechSynthesis.speak(utterance);
}, 1250);
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment