iT邦幫忙

0

Google自訂搜尋

請教一下,我今天在一個多國語言的網站弄了Google自訂搜尋
今天客戶想說有沒有辦法因為domain name的不同,抓出只屬於該語言的內容
譬如說下一個參數,搜尋的結果會是tw.xxx.com的內容
下另一個參數,搜尋的結果會是usa.xxx.com的內容

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

2
蟹老闆
iT邦大師 1 級 ‧ 2010-03-25 04:34:39
最佳解答

要使用多個網站搜尋可以使用參數as_sitesearch但前提是需要已在自訂搜尋中指定多個網站,如自訂搜尋中未指定則會搜不到資料。
位置在 控制台 - 網站 最多可加入五十個網址

<pre class="c" name="code">
<form action="你的搜尋頁" id="cse-search-box">   
  <div>   
    <input type="hidden" name="cx" value="自己的專屬ID" />   
    <input type="hidden" name="cof" value="FORID:10" />   
    <input type="hidden" name="ie" value="UTF-8" />   
    美國站<input type="radio" name="as_sitesearch" value="us.web.com" />   
    台灣站<input type="radio" name="as_sitesearch" value="tw.web.com" />   
    <input type="text" name="q" size="31" />   
    <input type="submit" name="sa" value="搜尋" />   
  </div>   
</form>   
<script type="text/javascript" src="自訂背景圖"></script> 

我要發表回答

立即登入回答