棉花糖 发表于 2011-8-15 11:50:09

动易系统防止采集的方法总结

1,先打开Include/PowerEasy.Article.asp文件

找到

If InStr(strHtml, "{$NextArticle}") > 0 Then strHtml = Replace(strHtml, "{$NextArticle}", GetNextArticle(200))

并将其替换成

If InStr(strHtml, "{$NextArticle}") > 0 Then strHtml = Replace(strHtml, "{$NextArticle}", GetNextArticle(200))

If InStr(strHtml, "{$ArticleAction_FY_FCJ}") > 0 Then strHtml = Replace(strHtml, "{$ArticleAction_FY_FCJ}", GetPrevArticle_FCJ())

再找到

'=================================================
'函数名:GetPrevArticle
'作 用:显示上一篇文章
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符

并在其上方加上

'=================================================
'函数名:GetPrevArticle_FCJ
'作 用:反采集函数部分 td tr table 修改
'=================================================
Private Function GetPrevArticle_FCJ()
Dim strAction_FCJ

if rsArticle("ArticleID") mod 8=1 then
strAction_FCJ="</td> </tr></table>"
elseif rsArticle("ArticleID") mod 8=2 then
strAction_FCJ="</td> </tr > </table>"
elseif rsArticle("ArticleID") mod 8=3 then
strAction_FCJ="</td > </tr> </table>"
elseif rsArticle("ArticleID") mod 8=4 then
strAction_FCJ="</td > </tr></table>"
elseif rsArticle("ArticleID") mod 8=5 then
strAction_FCJ="</td> </tr> </table>"
elseif rsArticle("ArticleID") mod 8=6 then
strAction_FCJ="</td> </tr></table >"
elseif rsArticle("ArticleID") mod 8=7 then
strAction_FCJ="</td> </tr ></table>"
else
strAction_FCJ="</td></tr></table>"
end if
GetPrevArticle_FCJ = strAction_FCJ

End Function

然后保存,上传到对应的WEB目录

第二步!!

将在文章内容模板里边的{$ArticleContent},注意此部 可视个人的模板情况而定!{$ArticleContent}之前是</td></tr> </table>,可将 </td></tr> </table> 替换成{$ArticleAction_FY_FCJ} ,然后直接生成模板就可以了!!如果不是的朋友,请看下文!!

特殊替换1:

将上面红色部分的判断代码,更换成适合你模板的代码!!如果{$ArticleContent}之前是

<td id=fontzoom style="WORD-BREAK: break-all" vAlign=top colSpan=2>那么您可以将上方红色部分的strAction_FCJ="</td> </tr></table>"
换成strAction_FCJ="<td id=fontzoom style=WORD-BREAK: break-all vAlign=top colSpan=2>"

并且每个strAction_FCJ等值的内容都不一样!如在里边加多个别空格或者将个别修改成大写或小写的字母等!可视个人情况来定!

注意:特殊替换1,如果您的代码中含有"的话,可以将其去掉,或者将"换成""

说下原理:

就是通过对采集固定码的干扰,来破坏采集者设定的规则!等于说,让我们每个内容页的内容都是无规则化!!


动易官方站上的方法:

解决方法:在模板中多个关键位置加上类似这样的代码,如:
<td zzz="{$ArticleID}">文章内容</td>
注意zzz="{$ArticleID}"使用无效的HTML标签,这样浏览器就不显示,但采集时因为无法设置开始代码或结束代码,无法保存规则。

采集原理:很多采集程序都是逐步捉取而拿到想要的内容的,通常情况下是截取头部和尾部来获取中间一部分,当你的文章列表或者内容没有规则,采集程序找不到您的通用头部和尾部的时候,自然就采集不了,这样别人就很难截取头部和尾部,这个防采集方法正是利用了这一点来实现防采集的。

例子:这里举例防止内容页采集,下面为内容页片段代码,大家留意一下,里面多了代码“zzz="{$ArticleID}"”,这代码就是防止采集的代码。

源代码:

<table class=tablebig cellSpacing=0 cellPadding=0 width=770 align=center border=0>
<tr>
<td class=tdleft>
<table class=pv110tablefull cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td vAlign=top>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td class=pv110title colSpan=2 zzz="{$ArticleID}">{$ArticleTitle}</td>
</tr>
<tr>
<td class=pv110info colSpan=2 >{$ArticleInfo}</td>
</tr>
<tr zzz="{$ArticleID}">
<td class=pv110picontent colSpan=2 zzz="{$ArticleID}">
{$ArticleContent}</td>
</tr>
<tr zzz="{$ArticleID}">
<td zzz="{$ArticleID}" class=pv110info align=right width=888>{$ArticleAction}</td>
</tr>
</table>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td width=16> </td>
<td width=754>{$PrevArticle}<BR>{$NextArticle}</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
如果之前已经建好的项目,现在重新采集,就会出现以下的错误信息:

我们改进一下 :

源代码

<table class=tablebig cellSpacing=0 cellPadding=0 width=770 align=center border=0>
<tr>
<td class=tdleft>
<table class=pv110tablefull cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td vAlign=top>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td class=pv110title colSpan=2 zzz="{$ArticleID}eedu">{$ArticleTitle}</td>
</tr>
<tr>
<td class=pv110info colSpan=2 >{$ArticleInfo}</td>
</tr>
<tr zzz="{$ArticleID}eedu">
<td class=pv110picontent colSpan=2 zzz="{$ArticleID}eedu">
{$ArticleContent}</td>
</tr>
<tr zzz="{$ArticleID}eedu">
<td zzz="{$ArticleID}eedu" class=pv110info align=right width=888>{$ArticleAction}</td>
</tr>
</table>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
<tr>
<td width=16> </td>
<td width=754>{$PrevArticle}<BR>{$NextArticle}</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

采集回来后,有你站的网站名称,你还会采集吗!

注意:在模板中多个关键位置加上类似这样的代码。

封IP防止采集方法:

       为了防止采集,我试过各种方法,绝大多数方法是“双刃剑”---防止了采集,也影响了搜索引擎收录,实在不爽!一日本人忽发奇想:何不采取封IP的办法防止采集,于是网上找一段最简单的封IP代码,一试,果然有效,企图采集者无功而返,经三个多月应用,已找不到采集者了,实在有点寂寞,哈哈。实践证明,本方法绝对不影响搜索收录!具体代码如下:


<%
Dim IP,IPString,VisitIP
'要禁止的IP地址
IPString="|61.233.40.201|61.240.131.121|127.0.0.1|211.154.44.169|219.150.14.36|"
'获取IP地址
IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If IP = "" Then
IP = Request.ServerVariables("REMOTE_ADDR")
End If
VisitIP="|"&IP&"|"
If instr(1,IPString,VisitIP)>0 Then
response.write "你的IP被禁止"
response.end
End If
%>

使用方法:

  将上述代码放到<head>区,如果不知道什么是<head>区,你就放到</head>上面即可!

  IPString="|61.233.40.201|61.240.131.121|127.0.0.1|211.154.44.169|219.150.14.36|"是采集你网站内容的垃圾站服务器IP,你可以自己替换,不知道对方服务器IP的可以点开始------运行-----输入ping www.*****.com(采集网站的网址)获得其IP!

  127.0.0.1是防止从本地采集,你可以在本地试试,因为现在许多新网站都是从本地采集,所以这个127.0.0.1一定要封它!

  现在许多网站程序有封IP功能,就不需要上述代码了,直接封其服务器IP就行!
页: [1]
查看完整版本: 动易系统防止采集的方法总结

请大家牢记南瓜园网址 www.nan2008.com