Created
September 28, 2017 02:53
-
-
Save ibolmo/4d407b49975ae94de3c586851f06c077 to your computer and use it in GitHub Desktop.
Get alerted when graylog has a new item.
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
count = () => $('.fields-row').length; | |
isEmpty = () => $('h1')[0].innerText == 'Nothing found'; | |
tick = () => { | |
if (isEmpty()) { | |
found = 0; | |
} else if (found < count()) { | |
alert('Found new stuff!'); | |
found = count(); | |
} | |
setTimeout(tick, 2000); | |
} | |
go = () => { | |
found = count(); | |
tick(); | |
} | |
go(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment