Lasso Soft Inc. > Home


AuthorBil Corry
LicensePublic Domain
Posted20 Jan 2006
Updated25 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]

Sample Usage

if: lp_client_isBot;
'Hello automated friend!';

Source Code

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.',
	-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;
		local:'client_browser' = client_browser;

	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);

	return: #typecode->(contains: (lp_client_browser: #client_browser)->(find:'typecode'));




No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft