diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-04-29 09:51:34 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-04-29 09:51:34 -0400 |
commit | 2e40a7f3b189877bf2d99a7056b5f2d598c1144d (patch) | |
tree | b5112338c6c5ffc7b2b17f224228634a77227a9d |
push stuff from the weekend
-rw-r--r-- | index.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/index.html b/index.html new file mode 100644 index 0000000..2ec249e --- /dev/null +++ b/index.html @@ -0,0 +1,33 @@ +<textarea rows="5" cols="80" id="input"> +</textarea> +<br> +<button value="Go" onclick="scrape()"/>Go</button> +</br> +<hr> +<div id='results'> +</div> + +<script> + +function write(stuff) { +document.getElementById('results').innerHTML += stuff; +} + +function scrape() { + data = document.getElementById("input").value + i=0; + regex = /#[0-9a-f]{3,6}[^[0-9a-f]/gi, result = [] + while ( (result = regex.exec(data)) ) { + i++; + console.log(result[0]); + write('<div>'); + write(result[0]); + write('<div style="height:2em;width:2em;background:' + result[0] + ';border:1px black solid;"></div>') + write('</div>') + } + if(i == 0) { + write('nothing found'); + } + +} +</script> |