Advanced | keywords | search engine//make Ant-felling yifa2008@hotmail.com can be modified arbitrarily
Last Updated on 2005-11-9
2005-11-9 will Yisou adjustment for Yahoo China Search (Yahoo China strategy change, Yisou curtain Call)
2005-9-24 revision, including Baidu promotion ranking position
Fscommand ("Allowscale", false);
var keyw_s:string;//original keyword
var keyw:array=["", "", "" "];//search engine three items in turn represent Baidu Google Yahoo
var url:string;//url
var searchstop:array=[true,true,true];//search Termination Flag
var searche:array=[true,true,true];//search engine Three entries in turn represent Baidu Google Yahoo
var inpage:number;//search Scope
var nowpage:array=[1,1,1];//current Search Page Three entries in turn represent Baidu Google Yahoo
var ingsearch:array=[false,false,false];//current Search Page Three entries in turn represent Baidu Google Yahoo
var searchlistener:object = new Object ()//Start Search button
Searchlistener.click=keysstart;
Keysstart_b.addeventlistener ("click", Searchlistener);
var stoplistener:object = new Object ()//Stop button
Stoplistener.click=function () {
Searchstop=[false,false,false];
Keysstart_b.addeventlistener ("click", Searchlistener);
Keysstart_b.enabled=true;
}
Keysstop_b.addeventlistener ("click", Stoplistener);
function Keysyahoo () {//find keyword ranking in yahoo
if (!searchstop[2] | | Number (nowpage[2]) >inpage) {//stop if it is terminated or exceeds the search scope
("Yahoo", nowpage[2],2,2);
return false;
}
("Yahoo", nowpage[2],1);
var mydata=new loadvars ();
var searchurl:string= "http://cn.search.yahoo.com/search?p=" +keyw[2]+ "&ei=utf-8&b=" + ((nowpage[2]-1) *10+1 );
Mydata.load (Searchurl);
Mydata.ondata=function (SRC) {
var tmpa=src.split (URL);
if (tmpa.length>1) {
var mys=tmpa[0];
var Mys=rps (Mys, ">[promotion]</a>", "snapshot of the Web");
var od= ((nowpage[2]-1) *10) + (Mys.split ("Web Snapshot"). Length;
System.usecodepage = false;
var spkeyw:string=escape (keyw_s);//Generate UrlEncode encoding for keywords in the connection
System.usecodepage = true;
Resrep ("Yahoo", RPS (SEARCHURL,KEYW[2],SPKEYW), od,2);
}else{
nowpage[2]++;
Keysyahoo ();
}
}
}
function Keysbaidu () {//Find keyword ranking in baiduu
if (!searchstop[0] | | Number (Nowpage[0]) >inpage) {//stop if it is terminated or exceeds the search scope
("Baidu", nowpage[0],2,0);
return false;
}
("Baidu", nowpage[0],1);
var mydata=new loadvars ();
var searchurl:string= "http://www.baidu.com/s?lm=0&si=&rn=10&ie=gb2312&ct=0&cl=3&wd=" + keyw[0]+ "&pn=" + ((nowpage[0]-1) *10);
Mydata.load (Searchurl);
Mydata.ondata=function (SRC) {
var tmpa=src.split (URL);
if (tmpa.length>1) {
var mys=tmpa[0];
var Mys=rps (Mys, "> Promotion </a>", "Baidu snapshot");
var od= ((nowpage[0]-1) *10) + (Mys.split ("Baidu snapshot"). Length;
Resrep ("Baidu", searchurl,od,0);
}else{
nowpage[0]++;
Keysbaidu ();
}
}
}
function Keysgoogle () {//find keyword ranking in google
if (!searchstop[1] | | Number (nowpage[1]) >inpage) {//stop if it is terminated or exceeds the search scope
("Google", nowpage[1],2,1);
return false;
}
("Google", nowpage[1],1);
var mydata=new loadvars ();
var searchurl:string= "http://www.google.com/search?q=" +keyw[1]+ "&hl=zh-cn&lr=&oe=gb2312&inlang= Zh-cn&start= "+ ((nowpage[1]-1) *10);
Mydata.load (Searchurl);
Mydata.ondata=function (SRC) {
var tmpa=src.split (URL);
if (tmpa.length>1) {
var mys=tmpa[0];
var od= ((nowpage[1]-1) *10) + (Mys.split ("Similar Web page"). Length;
System.usecodepage = false;
var spkeyw:string=escape (keyw_s);//Generate UrlEncode encoding for keywords in the connection
System.usecodepage = true;
Resrep ("Google", RPS (SEARCHURL,KEYW[1],SPKEYW), od,1);
}else{
nowpage[1]++;
Keysgoogle ();
}
}
}
function Se,np,op,seid {//op state 1 normal 2 stop
Switch (OP) {
Case 1:
Eval (se+ "_i"). text= "is querying page" +np+ ";
Break
Case 2:
Eval (se+ "_i"). text= "stopped in front" + (np-1) + "page not Found";
Ingsearch[seid]=false;
if (Ingsearch.join (",") = = "False,false,false") {
Backkeysstart ();
}
Break
Default
Eval (se+ "_i"). text= "Abnormal error Please try again";
}
}
function Resrep (Se,surl,od,seid) {//FINAL results Report
Eval (se+ "_i"). text=url+ "Rank" +od in the search results of the keyword "+keyw_s+";
Eval (se+ "Link_b"). _visible=true;
Eval (se+ "Link_b"). Onrelease=function () {
GetURL (sURL, "_blank");
}
Ingsearch[seid]=false;
if (Ingsearch.join (",") = = "False,false,false") {
Backkeysstart ();
}
}
function Backkeysstart () {//Search button re available
Keysstart_b.addeventlistener ("click", Searchlistener);
Keysstart_b.enabled=true;
Keysstart_b.label= "Start Query";
}
function RPS (txt,o,n) {//String substitution functions
var tmpa:array=txt.split (o);
var newstring=tmpa.join (n);
return newstring;
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.