เป็นสคริปสำหรับดึง ASIN จากหน้าเว็บ amazon ที่เปิดอยู่ครับ
javascript:(function(){var a="";var b=document.getElementById("center");if(b!=null)a+=b.innerHTML;b=document.getElementById("centerBelow");if(b!=null)a+=b.innerHTML;b=document.getElementById("zg_centerList");if(b!=null)a+=b.innerHTML;if(a=="")a=document.getElementsByTagName("body")[0].innerHTML;var c=a.match(/(\/(?![0-9])[A-Z0-9]{10}\/)/g);var d={},e="";for(var f=0,g=c.length;f<g;++f){var h=c[f].replace(/\//g,"");if(h in d)continue;e+=h+"<br/>";d[h]=1}var i="data:text/html,"+e;top.consoleRef=window.open(i,"myconsole","width=300,height=500,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1")})()
แบบดึงตามจำนวนหน้า
javascript:(function(){var%20e=parseInt(prompt("Page",""));window.pcount=0;var%20t=XMLHttpRequest.prototype.open;var%20n="";var%20r={},i="";var%20s=function(){var%20e="";var%20t=document.getElementById("center");if(t!=null)e+=t.innerHTML;t=document.getElementById("centerBelow");if(t!=null)e+=t.innerHTML;t=document.getElementById("zg_centerList");if(t!=null)e+=t.innerHTML;if(e=="")e=document.getElementsByTagName("body")[0].innerHTML;var%20n=e.match(/(\/(?![0-9])[A-Z0-9]{10}\/)/g);for(var%20s=0,o=n.length;s<o;++s){var%20u=n[s].replace(/\//g,"");if(u%20in%20r)continue;i+=u+"<br/>";r[u]=1}};var%20o=function(r){console.log(this.readyState);if(this.readyState==4&&window.pcount<e){if(n==jQuery(".pagnCur").text()){s();window.pcount++;jQuery("#pagnNextLink").click()}else{n=jQuery(".pagnCur").text()}}if(this.readyState==4&&window.pcount>=e){XMLHttpRequest.prototype.open=t;setTimeout(function(){var%20e="data:text/html,"+i;top.consoleRef=window.open(e,"myconsole","width=300,height=500,menubar=0,toolbar=0,status=0,scrollbars=1,resizable=1")},500)}};s();n=jQuery(".pagnCur").text();window.pcount++;(function(e){XMLHttpRequest.prototype.open=function(t,n,r,i,s){this.addEventListener("readystatechange",o);e.call(this,t,n,r,i,s)}})(XMLHttpRequest.prototype.open);jQuery("#pagnNextLink").click()})();
วิธีการใช้งานคือ
สร้าง Bookmark ใน Bookmarks Toolbar
จากนั้นก็ตั้งชื่อแล้วเอาโค้ดไปไว้ที่ช่อง Location:
เมื่อเปิดดูสินค้าในหน้าเว็บ amazon กดที่ bookmark ที่เราได้สร้างไว้ สคริปจะเปิดหน้าต่างใหม่ขึ้นมา
กด ctrl+s ที่หน้าต่างใหม่เพื่อเซฟเป็น text file ได้โดยง่าย
หวังว่าคงมีประโยชน์นะครับ
แก้ไขเกี่ยวกับเวลาเซฟครับ
แก้ไขหน้าใหม่แอมะซอนแล้วครับ
แก้ไขอีกครั้งครับ