หัวข้อ: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: nnuttdamm ที่ 09 ธันวาคม 2012, 16:52:26
วิธีวัดอันดับจาก google มีวิธีไหนบ้างครับ ว่าเราได้อันดับเท่าไหร่ หรือต้องนั่งหาเอง ขอบคุณครับ :wanwan017:
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: adjobb ที่ 09 ธันวาคม 2012, 17:15:58
จาก webmaster tool ครับ เขาจะบอกว่าเราติดคีย์อะไรบาง แล้วติดกี่คีย์ หลังจากที่ไปดูอันดับคีย์ว่าเราติดอันไหนบางแล้ว ทีนี้ถ้ามานั้งเปิดที่ละหน้ามันก็จะเหนื่อยใช่ไหมว่าติดหน้าไหนบางเว็บเรา ลองเอาสคิปนี้ไปช่วยงานดูครับช่วยได้เยอะ.... <?php if (isset($_GET['search'])){ set_time_limit (60); unset($_GET['search']); //set total num (total result) $total_num = ($_GET['total_num']>100) ?100:intval($_GET['total_num']); unset($_GET['total_num']); //set num (num per page) $num = ($_GET['num']<5) ?5:intval($_GET['num']); if ($num==10){ unset($_GET['num']); } //set default query $q = ''; foreach($_GET as $k=>$v){ $q.='&'.urlencode($k).'='.urlencode($v); } //request all result from google $s = ''; $start_num = 0; while ($start_num < $total_num) { $start = '&start='.$start_num; $buffer = file_get_contents('http://www.google.co.th/search?'.$q.$start); if (empty($buffer)){ $s .= '<cite>ERROR</cite>'; break; }else{ $buffer = strstr($buffer,'<ol>'); $s .= substr($buffer,0,strpos($buffer,'</ol>') 5); } $start_num = $num; } //create xml response header('Content-type:text/html;charset=tis-620'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("cache-Control: no-store, no-cache, must-revalidate"); header("cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $matches = array(); preg_match_all('/<cite>(. ?)</cite>/',$s,$matches,PREG_SET_ORDER); unset($s); $cites = ''; foreach($matches as $m){ list($c) = explode(' - ',strip_tags($m[1])); $c = preg_replace('/s /','',$c); $cites .= "<c>{$c}</c>"; } echo "<google>{$cites}</google>"; exit(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="th" xml:lang="th"> <head> <title>google order check tool</title> <meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> <script type="text/javascript"> /*<![CDATA[*/ var gTimer; var gProgress; function progress(){ if (gProgress){ gProgress.val(gProgress.val()*1 1); } gTimer = setTimeout('progress()',1000); } function clearProgress(){ gProgress.val(0); if (gTimer) clearTimeout(gTimer); } $(document).ready(function(){ var website = $('#website'); var num = $('#num'); var total_num = $('#total_num'); var keyword = $('#keyword'); var order = $('#order'); var result = $('#result'); gProgress = $('#progress'); $('#searchForm').submit(function(e){ var meta = $('input[name=meta]:checked'); var data; if (meta.val()=='') data = { q: keyword.val(), num: num.val(), total_num: total_num.val(), oe: 'ISO-8859-11', sa: 'N' }; else data = { hl: 'th', q: keyword.val(), as_qdr: 'all', num: num.val(), total_num: total_num.val(), meta: meta.val(), oe: 'ISO-8859-11', sa: 'N' }; $.ajax({ dataType: 'html', type: "GET", url: "?search", data: data, beforeSend: function() { clearProgress(); progress(); order.html(''); result.html(''); }, success: function(google) { var strOrder=''; var strResult=''; var websiteTrim=website.val().replace(/^s |s $/g,''); $('c',google).each(function(n){ var site = $(this).text(); n ; if (websiteTrim=='' || site.indexOf(websiteTrim) == -1) { strResult = n ': ' site '<br' ' />'; } else { strOrder = websiteTrim ' ติดอันดับที่ ' n ' ของ keyword '' keyword.val() ''<br' ' />'; strResult = n ': <span >' site '</span>' '<br' ' />'; } }); clearProgress(); result.hide(); if (strOrder=='') { order.html('ยังไม่ติดอันดับ ' total_num.val() ' อันดับแรก'); }else{ order.html(strOrder); } if (strResult=='') { result.html('ไม่พบผลลัพธ์จาก keyword นี้').show('normal'); }else{ result.html(strResult).show('normal'); } }, error: function(a,b,c){ alert(b); } }); return false; }); }); /*]]>*/ </script> </head> <body> <b>ค้นหา ว่า website 'website' ติด 100 อันดับแรกของ keyword 'keyword' หรือยัง</b> <div><form action="?" id="searchForm"> website: <input type="text" id="website" /> keyword: <input type="text" id="keyword" /> แสดงหน้าละ: <select id="num"> <option value="5">5</option> <option value="10" selected="selected">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> result: <select id="total_num"> <option value="5">5</option> <option value="10">10</option> <option value="20" selected="selected">20</option> <option value="30">30</option> <option value="40">40</option> <option value="50">50</option> <option value="60">60</option> <option value="70">70</option> <option value="80">80</option> <option value="90">90</option> <option value="100">100</option> </select> ค้นหา : <input type="radio" name="meta" value="" checked="checked" />เว็บ <input type="radio" name="meta" value="lr=lang_th" />หน้าที่เป็นภาษาไทย <input type="radio" name="meta" value="cr=countryTH" />เว็บจากประเทศไทย progress: <input type="text" id="progress" /> <input type="submit" id="request" value="search" /> </form></div> <div style="background-color:yellow"> อันดับ : <span id="order"></span> </div> <div style="background-"> ผลลัพธ์ : <span id="result"></span> </div> </body> </html>
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: Bright289 ที่ 09 ธันวาคม 2012, 17:21:37
เวลาใช้คือกอปลง notepad เซป.html หรอครับ
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: monkeyz ที่ 09 ธันวาคม 2012, 22:16:37
ผมใช้ noteped เซฟเป็น html แล้วมันขึ้นแบบนี้ไม่ทราบทำถูกหรือเปล่าครับ 100) ?100:intval($_GET['total_num']); unset($_GET['total_num']); //set num (num per page) $num = ($_GET['num']<5) ?5:intval($_GET['num']); if ($num==10){ unset($_GET['num']); } //set default query $q = ''; foreach($_GET as $k=>$v){ $q.='&'.urlencode($k).'='.urlencode($v); } //request all result from google $s = ''; $start_num = 0; while ($start_num < $total_num) { $start = '&start='.$start_num; $buffer = file_get_contents('http://www.google.co.th/search?'.$q.$start); if (empty($buffer)){ $s .= 'ERROR'; break; }else{ $buffer = strstr($buffer,'
'); $s .= substr($buffer,0,strpos($buffer,'
') 5); } $start_num = $num; } //create xml response header('Content-type:text/html;charset=tis-620'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("cache-Control: no-store, no-cache, must-revalidate"); header("cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $matches = array(); preg_match_all('/(. ?)/',$s,$matches,PREG_SET_ORDER); unset($s); $cites = ''; foreach($matches as $m){ list($c) = explode(' - ',strip_tags($m[1])); $c = preg_replace('/s /','',$c); $cites .= "{$c}"; } echo "{$cites}"; exit(); } ?> ค้นหา ว่า website 'website' ติด 100 อันดับแรกของ keyword 'keyword' หรือยัง แล้วลองค้นหาไม่ขึ้นอะไรเลยครับ :P :P :P
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: smon19 ที่ 09 ธันวาคม 2012, 22:21:35
ลุ้นๆ เลย
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: adjobb ที่ 09 ธันวาคม 2012, 22:23:28
เป็น PHP ครับแล้วอัพขึ้นโฮสหรือ AppServ เวลาใช้คือกอปลง notepad เซป.html หรอครับ
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: Principal ที่ 09 ธันวาคม 2012, 22:23:45
ขอเม้นไว้ก่อนพรุ้งนี้จะลองดูครับ
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: barbarian ที่ 15 ธันวาคม 2012, 11:02:09
ขอเก็บไปลองซ่ะหน่อย
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: seoโออิชิ ที่ 15 ธันวาคม 2012, 11:35:29
webmaster tool ครับ ดีที่สุดในโลก ติดอันดับเท่าไหร่กี่คีย์ แต่ละคีย์อันดับเท่าไหร่ แต่ละคีย์มีการค้นหา และเปอเซ็นclickเท่าไหร่มีหมด
หัวข้อ: Re: วิธีวัดอันดับจาก google
เริ่มหัวข้อโดย: siamseo ที่ 15 ธันวาคม 2012, 11:38:07
ต้องลอง :wanwan020:
|