Well, this is impossible to do. You cannot see if the bot or browser is viewing the token page. Everything you could check can also be imitated. (Referrers, more hashes or user agents)
You have to ask yourself, what do you want to protect your site from? For a regular bot, you're fine, it will take you too long to crack your script and spam only on your site. This will go on and spam someone else. This way your script will give enough protection.
When someone only targets your site, and he takes the time to hack it, he is likely to succeed. So you also want to leave such bots / people? I would suggest displaying captcha after, for example, 3 messages within an hour from one IP address. This will keep them out.
It's not always about being fully protected, your decision might already be good enough ... If you need more protection, just use captchas or something like that.
Mac_Cain13
source share