awLatestSearchs beta1.1的修改:增加msn與百度搜尋結果

發現自動女巫剛釋出awLatestSearchs beta1.1裡,在#netscape的段落中,將search.netscape誤植searcht.netscape。另稍微修改了yahoo的搜尋,將搜尋引擎設定為tw.search.yahoo,比較符合台灣搜尋的習慣。又參考kzeng的建議,稍稍修改了百度的code,同理,於是增加了MSN Search,這還可以一直加下去,希望有所幫助。不過我沒管結果是不是在第一頁就是了,我也不會。在我的drupal上可以正確顯示就行了。(真的,稿壓大的時候特別喜歡作「別」的事情)

msn與baidu的code如下:

<?php
...
    
#MSN
     
if (strpos($refer->url'ttp://search.msn.com'1) == ||
        
strpos($refer->url'ttp://msn.'1) == 1) {
      
$count++;
      
$link $refer->url;
      
$text preg_replace('/^.*?q=/'''$refer->url);
      
$text preg_replace('/&.*$/'''$text);
      
$text _awLatestSearches_cleanupText($text);
      if (
strpos($link'page=') === FALSE ||
          
strpos($links'page=1') > 0)
        
$firstPage TRUE;
      else
        
$firstPage FALSE;
      
$output .= '<i>MSN:</i> ' . (($firstPage) ? '* ' '') .
          
l($text$link) . '<br/>';
    }
#Baidu
   
else if (strpos($refer->url'ttp://www.baidu.'1) == 1) {
      
$count++;
      
$link $refer->url;
      
$text preg_replace('/^.*?wd=/'''$refer->url);
      
$text preg_replace('/&.*$/'''$text);
      
$text _awLatestSearches_cleanupText($text);
      if (
strpos($link'&start=') === FALSE &&
          
strpos($link'&b=') == FALSE)
        
$firstPage TRUE;
      else
        
$firstPage FALSE;
      
$output .= '<i>Baidu:</i> ' . (($firstPage) ? '* ''') .
          
l($text$link) . '<br/>';
    }
...
?>

剛剛發現,這裡有一個比較完整的修改。不過SUNZY改過的code似乎與我的主機環境水土不服,只好作罷。我胡亂改的東西,似乎在coding GB碼上,有點問題。

poker vpn Allofmp3 All of mp3