Google的PageRank的計算公式是由該公司創辦人Larry Page所創造的, 不過現在的計算PageRank方法應該不止是這個單一公式, 還加入很多的外在因素計算, 公式計算參考如下:
假設Page A有Page T1…Tn的Link指到它,則Page A所得到的PageRank計算公式如下:
PR(A) = (1-d) + d(PR(T1)/C(T1) + ... + PR(Tn)/C(Tn))
d: 阻尼因素damping factor就是從link你的網頁所獲得的實際PR分值, 阻尼因素一般是0.85 , 阻尼因素主要是在降低其它頁面所造成影響。
PR(T1): 表示有連結到本頁面的外部Page 1本身的PR值
C(T1): 表示有連結到本頁面的外部Page 1連結到外部的所有連結數量
PR(T1)/C(T1): 從連結到本頁面的外部Page 1所得到的PR值
PR(Tn): 表示有連結到本頁面的外部Page n本身的PR值
C(Tn): 表示有連結到本頁面的外部Page n連結到外部的所有連結數量
PR(Tn)/C(Tn): 從連結到本頁面的外部Page n所得到的PR值
(1-d): 某個page沒有任何外部連結到該page時, 該page的PR為0.15
例: 如果 www.abc.com 的PR為4, 此頁面共有2個對外連結, 其中一個連到你的page, www.def.com 的PR為3, 有12個對外連結,其中一個連到你的page, 你的page得到的PR為:
(1-0.85)+0.85(4/2+3/12) = 2.065
p.s. 阻尼因素 d 是Google用來控制PR值高低的一個很有趣的變數
2007年9月22日 星期六
電子商務的搜尋引擎關鍵字行銷, 搜尋引擎優化(SEO)重點
要了解搜尋引擎優化的重點, 我個人認為最首要的是要站在搜尋引擎業者的角度來思考這個問題.
搜尋引擎最終的目的是要找出Web User所輸入keyword時能找到最符合他們所需的網頁, 因此才會延伸出以PageRank來表達頁面的重要性的種種演算法來盡量找出重要的頁面給user(但不一定100%符合需要), 所以在廣大的網海中或許還有很多網頁沒被搜尋引擎頁者所派出的網路蜘蛛(web crawler)給抓到. 可以想見的是, 搜尋引擎與優質content page是魚幫水, 水幫魚的!
對於搜尋引擎優化重點, 目前我的看法是, 如何讓web crawler或其它content收集機制更容易辨識網頁內容的正確性及重要性, 應該有以下幾個重點:
1.根據搜尋引擎的PageRank計算公式來看, 網頁本身高品質的的incoming links和outgoing links對網頁的重要性有關鍵的影響
2.如果DMOZ收錄了你的網站, 那麼Google, Lycos, Netscape, AOL,HotBot....等一些大型的搜尋引擎網站也會跟著收錄
3.網站的內容皆為原創性, 不是抄襲來的
4.網頁內容遵循SEO的規則, 含html內容的title, meta data, hyper link文字與連結的正確性與重要性, h1標題, 圖片alt, ....
5.不濫用關鍵字詞, 不做SPAM
6.網址與網頁相關性
7.盡量避免動態產生頁面
8.網頁經常更新, 但網站的整體架構避免有大幅度修改
9.網頁設計不用framset切畫面, 少用影音檔(如Flash)
10. index 與 default 頁面的建立與link內容的適切性
11.網頁內容的html檔避免過大
12.避免彈出視窗過多, 避免網站內部的連結太多層及無效連結
13.網頁內容不要用自創的一些新的字詞, 因為幾乎不會有人輸入這種字詞去搜尋
14.如果可以的話, 跟google申請adsense放到自己網站, 因為google為了統計adsense廣告效益, 所以google的web crawler一定會去爬有放adsense的網站
15.針對title,meta tag, body內容裡的關鍵詞多重排列組合及注重關鍵詞涵蓋面的廣度
16.網站主題規劃與豐富且受歡迎的網站內容
其它的以後想到再寫...
搜尋引擎最終的目的是要找出Web User所輸入keyword時能找到最符合他們所需的網頁, 因此才會延伸出以PageRank來表達頁面的重要性的種種演算法來盡量找出重要的頁面給user(但不一定100%符合需要), 所以在廣大的網海中或許還有很多網頁沒被搜尋引擎頁者所派出的網路蜘蛛(web crawler)給抓到. 可以想見的是, 搜尋引擎與優質content page是魚幫水, 水幫魚的!
對於搜尋引擎優化重點, 目前我的看法是, 如何讓web crawler或其它content收集機制更容易辨識網頁內容的正確性及重要性, 應該有以下幾個重點:
1.根據搜尋引擎的PageRank計算公式來看, 網頁本身高品質的的incoming links和outgoing links對網頁的重要性有關鍵的影響
2.如果DMOZ收錄了你的網站, 那麼Google, Lycos, Netscape, AOL,HotBot....等一些大型的搜尋引擎網站也會跟著收錄
3.網站的內容皆為原創性, 不是抄襲來的
4.網頁內容遵循SEO的規則, 含html內容的title, meta data, hyper link文字與連結的正確性與重要性, h1標題, 圖片alt, ....
5.不濫用關鍵字詞, 不做SPAM
6.網址與網頁相關性
7.盡量避免動態產生頁面
8.網頁經常更新, 但網站的整體架構避免有大幅度修改
9.網頁設計不用framset切畫面, 少用影音檔(如Flash)
10. index 與 default 頁面的建立與link內容的適切性
11.網頁內容的html檔避免過大
12.避免彈出視窗過多, 避免網站內部的連結太多層及無效連結
13.網頁內容不要用自創的一些新的字詞, 因為幾乎不會有人輸入這種字詞去搜尋
14.如果可以的話, 跟google申請adsense放到自己網站, 因為google為了統計adsense廣告效益, 所以google的web crawler一定會去爬有放adsense的網站
15.針對title,meta tag, body內容裡的關鍵詞多重排列組合及注重關鍵詞涵蓋面的廣度
16.網站主題規劃與豐富且受歡迎的網站內容
其它的以後想到再寫...
2007年9月19日 星期三
用JAVASCRIPT限制TextBox只能輸入數字或英文字...等
用JAVASCRIPT限制TextBox只能輸入數字或英文字...等
參考網址: http://bbs.flash2u.com.tw/FlashTopic51745_85_8_9.htm
文字框輸入限制:
<script>
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>
小寫英文:<xmp style= "display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[a-z]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[a-z]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[a-z]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"
><br>
大寫英文:<xmp style= "display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[A-Z]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[A-Z]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[A-Z]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled">
<br>
任意數字:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"><br>
限2位小數:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"> 如: 123.12<br>
日 期:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^d{1,4}([-/](d{1,2}([-/](d{1,2})?)?)?)?$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^d{1,4}([-/](d{1,2}([-/](d{1,2})?)?)?)?$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^d{1,4}([-/](d{1,2}([-/](d{1,2})?)?)?)?$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"> 如: 2002-9-29<br>
任意中文:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[u4E00-u9FA5]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[u4E00-u9FA5]*$/, event.dataTransfer.getData('Text'))"><br>
部分英文:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[a-e]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[a-e]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[a-e]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"> 範圍: a,b,c,d,e<br>
部分中文:<xmp style="display:inline"> </xmp>
<script language=javascript>
function checkChinese(oldLength, obj)
{
var oTR = window.document.selection.createRange()
var reg = /[^一二三四五六七八九十]/g
oTR.moveStart("character", -1*(obj.value.length-oldLength))
oTR.text = oTR.text.replace(reg, "")
}
</script>
<input onkeypress="return false" onkeydown="setTimeout('checkChinese('+this.value.length+','+this.uniqueID+')', 1)"
onpaste = "return regInput(this, /^[一二三四五六七八九十]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[一二三四五六七八九十]*$/, event.dataTransfer.getData('Text'))"
> 範圍: 一二三四五六七八九十
參考網址: http://bbs.flash2u.com.tw/FlashTopic51745_85_8_9.htm
文字框輸入限制:
<script>
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
</script>
小寫英文:<xmp style= "display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[a-z]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[a-z]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[a-z]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"
><br>
大寫英文:<xmp style= "display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[A-Z]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[A-Z]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[A-Z]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled">
<br>
任意數字:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"><br>
限2位小數:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"> 如: 123.12<br>
日 期:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^d{1,4}([-/](d{1,2}([-/](d{1,2})?)?)?)?$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^d{1,4}([-/](d{1,2}([-/](d{1,2})?)?)?)?$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^d{1,4}([-/](d{1,2}([-/](d{1,2})?)?)?)?$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"> 如: 2002-9-29<br>
任意中文:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[u4E00-u9FA5]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[u4E00-u9FA5]*$/, event.dataTransfer.getData('Text'))"><br>
部分英文:<xmp style="display:inline"> </xmp>
<input onkeypress = "return regInput(this, /^[a-e]*$/, String.fromCharCode(event.keyCode))"
onpaste = "return regInput(this, /^[a-e]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[a-e]*$/, event.dataTransfer.getData('Text'))"
style="ime-modeisabled"> 範圍: a,b,c,d,e<br>
部分中文:<xmp style="display:inline"> </xmp>
<script language=javascript>
function checkChinese(oldLength, obj)
{
var oTR = window.document.selection.createRange()
var reg = /[^一二三四五六七八九十]/g
oTR.moveStart("character", -1*(obj.value.length-oldLength))
oTR.text = oTR.text.replace(reg, "")
}
</script>
<input onkeypress="return false" onkeydown="setTimeout('checkChinese('+this.value.length+','+this.uniqueID+')', 1)"
onpaste = "return regInput(this, /^[一二三四五六七八九十]*$/, window.clipboardData.getData('Text'))"
ondrop = "return regInput(this, /^[一二三四五六七八九十]*$/, event.dataTransfer.getData('Text'))"
> 範圍: 一二三四五六七八九十
訂閱:
文章 (Atom)