Ever wanted something to count all the repeated words and highlight each word with a different color? No? Well I did!
I looked around but didn't find what I wanted so I wrote my own. A quick & dirty PHP script. It was a good waste of those extra 3 hours I had.
Caveats
Script limitations/bugs:
- All punctuation is removed
- Some long words are not counted for some reason
- The colors are random so some may not be pleasant
- Sometimes it matches partial words sometimes it doesn't.
Script Types
I wrote 2 scripts: One for use for the command line (read from a text file and outputs to shell, which you could redirect to another file) and another for the web. You can modify the web one to make it check URLs directly, but I'm warning you: It'll massacre all kinds of styling and you'll need to do some extra work to make work properly.
Links
You can [ab]use the script here: http://sectorx.org/word-highlight-web.php
The scripts are available freely for download & redistribution as long as the credits are retained. If you make enhancements to the scripts, I'd appreciate it if you send them back to me to add them to the others (with your credits retained of course).
Demo
What better demo is than to test it on cats and geeks? :D
Yes, I cheated by manually placing the text in the middle for a better screenshot. Spank me for being bad.
No comments:
Post a Comment