Link | lp_client_isBot |
Author | Bil Corry |
Category | Client |
Version | 8.x |
License | Public Domain |
Posted | 20 Jan 2006 |
Updated | 25 Feb 2009 |
More by this author... |
Returns true if client is a bot, spider, validator, robot or crawler. It's based on user-agent, so it won't identify any bot that doesn't identify itself via the user-agent.
Requires [lp_client_browser]
if: lp_client_isBot; 'Hello automated friend!'; /if;
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
[ define_tag: 'lp_client_isBot', -description='Returns true if client is a bot, spider, validator, robot or crawler.', -priority='replace', -optional='user_agent', // test a user agent string -optional='deny', // returns true when code matches, all else reported false -optional='allow', // returns false when code matches, all else reported true -optional='strict', // only return true for known bots -optional='loose'; // true for known bots and suspected bots and unknown clients if: local_defined:'user_agent'; local:'client_browser' = #user_agent; else; local:'client_browser' = client_browser; /if; local:'typecode' = 'CDEFLORSVX'; // default if: local_defined:'strict'; local:'typecode' = 'CDEFLORSV'; else: local_defined:'loose'; local:'typecode' = 'CDEFLORSUVX'; else: local_defined:'deny'; local:'typecode' = (string: #deny); else: local_defined:'allow'; local:'typecode' = 'BCDEFLMOPRSUVX'; iterate: (string: #allow), local:'chr'; #typecode->(remove: #typecode->(find: #chr), 1); /iterate; /if; return: #typecode->(contains: (lp_client_browser: #client_browser)->(find:'typecode')); /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft