![]() |
Noob Zapper
I decided, out of boredom, to make our lives easier.
Periodically, one comes across posts similar to the following: #include <iostream> using namespaces;; //WTF? this isnt in mah book int main() { while (1 + 1 > -2487928746) { cin >> cout << "hallo wurld!!1one";; } } } i dunno what's wrong with dis but i have an exam tomorrow kthx Yes, people need to learn to use code tags, but it's a serious waste of time to nag them and check the thread again later. I wrote a GreaseMonkey script to automagically wrap stuff in code tags that probably should be. The code kind of looks like a bunch of duct-tape, which it is, but it works reasonably well for the poorly tagged posts that I've tried it on (which were kindly annotated with flaming and thus easy to search for). You need GreaseMonkey installed in a compatible browser to use the script. Get the script here. Make sure the little monkey icon is smiling (click to toggle GreaseMonkey on and off) and browse around for naked code. Subtle Hint: Refresh this page I'll link some good test posts later. |
Example pages
http://www.programmingforums.org/for...h-my-code.html Very very simple case http://www.programmingforums.org/for...-cin-cout.html Note that the line after the code is properly not included, despite containing code-like elements. I may have to make #include a special case, since it is usually found in the first few lines. http://www.programmingforums.org/for...g-the-nim.html Multiple auto-tagged sections in a single post. It possibly should have been one big section, but there was just enough whitespace between them. May need to add detection for // and /* style comments. http://www.programmingforums.org/for...en-i-use-.html Note that in post #3, the auto-tagged section stops right before the descriptive text, even though it contains lots of code-like stuff. |
Works great for me :)
|
Nice.
|
New version with an extra button that puts a canned response in the quick-reply area. The message can be changed (or the button disabled completely) in the config section. Right click the monkey, Manage User Scripts, Edit.
|
And here I was hoping this 'noob zapper' would deliver a mild electrical shock to the offenders. :(
|
Any reason it doesn't include the #include <iostream> ?
Oh, and if you can make it use [highlight] for every specific language, depending on what section it is, that would be grate :p |
Quote:
Quote:
|
Uuu.. didn't think about that :).
Good work till now mate. Hope it won't make me too lazy and stop using code tags :D |
I love it. Nice job
|
| All times are GMT -5. The time now is 4:53 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC