Forum Moderators: goodroi
Hey who am I to question his motives, I just try to accomidate.
I could of course replace the text with images, but that's a bit extreme. I have to do something though....
thx
Hmmm...
I could the user agent to determine if it a bot.
( like in a log program )
Dim varAgent,strBots,arrBots,lenBots,chkBots,boolBots,strDefered
boolBots = False
varAgent = Request.ServerVariables("HTTP_USER_AGENT")
strBots = "bot,slurp,crawler,spider,archiver,grub,crawl,Crawler,Bot,Slurp,Spider,Downloader"
arrBots = Split(strBots,",")
lenBots = UBound(arrBots)
For i = 0 to lenBots
chkBots = instr(varAgent,arrBots(i))
If chkBots > 0 Then
boolBots = true
End If
Next
If boolBots = False Then
strDefered = "defered adjudiction"
Else
strDefered = ""
End If
Then on the page:
Blah Blah Blah <%= strDefered %> Blah Blah Blah
The Search Engines should never know the difference...
SEO isn't my thing (or I'm slow) so the solution outlined above doesn't help me out too much. Any advice on this or on how to implement the solution above?
Thanks-
Defe<!--comment-->rred Adjudi<!--comment-->cation
Instead of using a comment tag, you could add some random text where I have the comment tag above and use css to set it's display to none.
Def<span style="display:none;">blablabla</span>erred Adjudi<span style="display:none;">blablabla</span>cation
For other people to use I can change the script so it catches any of the words in a list to make it easy.
Copy and paste the lines below
***** From Here
<%
Dim varAgent,strBots,strWordsList,arrBots,arrWordsList,lenBots,lenWordsList,chkBots,boolBots,j
boolBots = False
varAgent = Request.ServerVariables("HTTP_USER_AGENT")
' Words designed to catch a search robot
strBots = "bot,slurp,crawler,spider,archiver,grub,crawl,Crawler,Bot,Slurp,Spider,Downloader"
' Words you might use and want to remove
strWordsList = "legal phrase 1, legal phrase 2, legal phrase 3, legal phrase 4, legal phrase 5"
arrBots = Split(strBots,",")
lenBots = UBound(arrBots)
arrWordsList = Split(strWordsList,",")
lenWordsList = UBound(arrWordsList)
For i = 0 to lenBots
chkBots = instr(varAgent,arrBots(i))
If chkBots > 0 Then
boolBots = true
End If
Next
Sub Write_words()
If boolBots = False Then
Response.Write(arrWordsList(j))
j=j+1
Else
strDefered = ""
End If
End Sub
%>
<html>
This is <% Call Write_words() %> it should be followed by<br>
<% Call Write_words() %> which if this were a bot would not be seen. <br>
Oh yeah, This is <% Call Write_words() %> followed by<br>
<% Call Write_words() %> <br>
****** To Here
** Very important. Notice how I placed the phrases in order on the list as I would use them on the page. **
strWordsList = "A,B,C ..etc.. %>
I want to hide this <% A %> and I want to hide this <% B %> and I want to hide this <% C %> etc...
Also if you want to test this script replace:
varAgent = Request.ServerVariables("HTTP_USER_AGENT")
with:
varAgent = "IRLbot/1.0 (+http://irl.cs.tamu.edu/crawler)"
Just a bot that visited my sites USER_AGENT
I like the clean simplicity of Philo's solution, and suggest this little twist:
Def<!--inition-->erred Adju<!--stment in-->dication ..
Anyone looking might assume that the <!-- slipped in by accident,
that the words Definition, erred, adjustment, and indication were intended.
When rendered on-screen, 'Deferred Adjudication' appears of course.
I doubt any SE on Earth would bother unscrambling that,
or that there would be any penalty for doing so. - Larry
$html =<<<EHTML
<h1>HTML document</h1>
<p>Your html document goes here</p>
EHTML;
$rewrite = array(
"html"=>"xhtml",
"here"=>"there"
);
if (preg_match("#(google¦slurp@inktomi¦yahoo! slurp¦msnbot)#si", $_SERVER['HTTP_USER_AGENT']))
{
foreach($rewrite as $val=>$key)
{
if (preg_match("/$val/",$html))
{
$html = preg_replace("/$val/","$key",$html);
}
}
}
#############
echo $html;
#############
?>
The comment idea is simple and should work. Although I thought SE's ignored commented script altogether.
Originally when I started making websites I used Flash quite alot and it exports a list of commented keywords based on what's on the .SWF.
For a long time our site was visited but SE's seemed to ignore the commented script. It wasn't until I placed the .SWF file on top of some hidden text with absolute positioning that I started seeing results.