|
以上是NICEWORDS官网的网站,开始还真被它唬住了,以为真的是搜索引擎技术来实现的呢,后来将程序下载下来破解后解读出来才知道,以下解读下它的核心文件include/func.inc.php,破解后源代码如下
function update_rss( $condition = "level<2" )
{
global $gRss_ExpireTime;
global $db;
global $gConfig;
$sql = "SELECT * FROM `#___#words` WHERE ".$condition." AND lastupdate < '".( time( ) - $gRss_ExpireTime )."' AND article_count > -1 ORDER BY lastupdate ";
$rss_list = $db->getall( $sql );
if ( empty( $rss_list ) )
{
foreach ( $rss_list as $key => $row )
{
$sql = "UPDATE `#___#words` SET `lastupdate` = '".time( )."' WHERE `id` = ".$row['id'];
$db->execute( $sql );
$rssurl = $row['rssurl'];
if ( empty( $rssurl ) || substr( $rssurl, 0, 7 ) != "http://" )
{
$rssurl = base64_decode( "aHR0cDovL2Jsb2cueW9kYW8uY29tL3NlYXJjaHJzcz9xPQ==" ).urlencode( $row['word'] );
}
$rss = fetch_rss( $rssurl );
if ( false == $rss )
{
$sql = "UPDATE `#___#words` SET article_count ='-1' WHERE `id` = ".$row['id'];
$db->execute( $sql );
debugmsg( " word为 ".$row['word']." 关键词获取信息失败!! " );
}
else
{
$suc_i = 0;
foreach ( $rss->items as $item )
{
if ( strlen( trim( $item['description'] ) ) < 800 )
{
$item['title'] = str_replace( "<font color=\"#c60a00\">", "", str_replace( "</font>", "", $item['title'] ) );
$flag_forbid = false;
$arrforbid = explode( ",", $gConfig['SiteSetting']['Forbid'] );
$item['isdeleted'] = 1 == $gConfig['SiteSetting']['Approve'] ? -1 : 0;
$item['author'] = $item['author'];
$item['linkmd5'] = md5( preg_replace( "/[ \\/\\:\\?&]/", "", $item['link'] ) );
$t = strtotime( $item['pubDate'] );
if ( empty( $t ) )
{
$t = strtotime( $item['pubdate'] );
}
if ( empty( $t ) )
{
$t = time( );
}
$item['pubDate'] = date( "Y-m-d H:i:s", $t );
$item['addtime'] = time( );
$item['word'] = $row['word'];
$canSql = "SELECT count(*) FROM `#___#articles` WHERE linkmd5 ='".$item['linkmd5']."'";
usleep( 100000 );
if ( !( $db->getone( $canSql ) == 0 ) )
{
continue;
}
else if ( empty( $arrforbid ) )
{
foreach ( $arrforbid as $forbid )
{
if ( @strpos( @$item['title'].@$item['description'], $forbid ) )
{
$flag_forbid = true;
}
else
{
usleep( 5000 );
}
}
if ( true == $flag_forbid )
{
debugmsg( "文章“".$item['title']."”含有禁止关键词,放弃" );
}
}
else
{
$sql = $db->getinsertsql( "articles", $item );
if ( $db->execute( $sql ) )
{
++$suc_i;
}
}
}
}
debugmsg( " ID为".$row['id']." , word为".$row['word'].( " 的记录成功更新 ".$suc_i." 篇文章 " ) );
$sql = " UPDATE #___#words SET article_count = (SELECT COUNT(*) FROM #___#articles WHERE word ='".$row['word']."') WHERE `id` = ".$row['id'];
$db->execute( $sql );
set_step_increase( );
}
}
}
}
其中最重要的部分是base64_decode( "aHR0cDovL2Jsb2cueW9kYW8uY29tL3NlYXJjaHJzcz9xPQ==" )
通过PHP输出后变为http://blog.yodao.com/searchrss?q=,聪明的大家看懂的了吧,是通过有道博客引擎获得的RSS数据源,通过这个进行解析出数据,其实谷歌、SINA等都有类似的搜索RSS数据源,之所以选择了有道博客,是因为他的RSS输出的内容部分是全部的,而其他的引擎都只是输出摘要;
貌似那个爱聚合也是使用的这个办法,所以大家没必要花钱去买他那个了,哈哈
另外就是如果各位谁想破解PHP加密的可以找我,一个文件100元人民币,10个以上可打折,哈哈 |
|