|
我要采集百度空间的用户名, 但是发现他搜索结果压根没有地址,大家看看,好象是一段JAVAscript,大家帮帮忙呀,小弟感激不尽。
http://ren.baidu.com/uquery/?type=2&fn=0&word=&ln=10&sex1=0&sex2=0&sex3=0&age_from=18&age_to=26&marry=0&blood=0&zodiac=0&space_ok=0&vocation=0&education=0&birth_province=&birth_city=&birth_home=&birth_other=&reside_province=&reside_city=&reside_home=&reside_other=&tag_school=&tag_book=&tag_music=&tag_movie=&tag_sport=&tag_person=&tag_other=&tag_brand=&tag_unit=&&pn=1
我把没用的代码删除光了,剩下下面这段代码有用
-
- <script language="JavaScript" src="http://passport.baidu.com/js/renquery.js" type="text/JavaScript"></script>
- <div id="result">
-
-
- <script language="javascript">
- function getData(){
- var head = document.getElementsByTagName("head")[0];
- var s= document.createElement("script");
- s.type="text/javascript";
- s.src="http://pdc.baidu.com/uinfo/?
- callback=getuserinfo&type=json&uids=87075979c093861ab151b979,32d6e036257fe9f2b211c7b2,7688aaa1c9c8e1fefaed5002,d97f10f0de4fc4375d60086e,68082156eb5ec487810a18e5,0389618127a6c6ff
- 513d928e,7688aaa1aca444fbfaed5020,50488d103d1204f21bd576cd,fdae5b161377560735fa4192,8f036e5f1c00f62443a75b29&randin=250645236&detaillen=256&t="+new Date().getTime();
- head.appendChild(s);
- };
- getData();
- function getuserinfo(json_rs1){
- var i=0;
- var json_rs=new Array();
- var tpr=new Array();
- for(var property in json_rs1){
- json_rs[i]=json_rs1[property];
- tpr.push('<tr height="120"><td width="120" valign="top" align="center"><a target="_blank" href="http://hi.baidu.com/sys/checkuser/'+json_rs[i].enusername+'/0"><img border="0"
- src="http://himg.baidu.com/sys/portrait/item/'+json_rs[i].iconurl+'.jpg"/></a><div class="opt"><a onclick="return ui_af(\''+json_rs[i].username+'\');" href="#"><img border="0"
- align="absmiddle" title="加为好友" src="http://img.baidu.com/hi/img/ico_adfriend.gif"/></a> <a target="_blank" href="http://msg.baidu.com/ms?
- ct=21&cm=1&tn=bmSendMessage&un='+json_rs[i].enusername+'"><img border="0" align="absmiddle" title="发送消息"
- src="http://img.baidu.com/hi/img/ico_sendmsg.gif"/></a></div></td><td valign="top" class="f"><a target="_blank" href="http://hi.baidu.com/sys/checkuser/'+json_rs
- [i].enusername+'/0">'+json_rs[i].username+'</a>');
- if(json_rs[i].tag_space=="1"){
- if(json_rs[i].space_url != "") tpr.push("<a href='http://hi.baidu.com/"+json_rs[i].space_url+"' target='_blank'><img
- src='http://img.baidu.com/passport/hi.gif' border='0' align='absmiddle' /></a>");
- else tpr.push("<img src='http://img.baidu.com/passport/hi.gif' border='0' align='absmiddle' />");
- }
- tpr.push("<br/><span>");
- tpr.push(setSelfIntro(json_rs[i].sex, json_rs[i].age, "0", json_rs[i].reside));
- tpr.push('</span><div class="line1"> </div>');
- tpr.push(insertWbr(json_rs[i].detail, 5));
- tpr.push("</td></tr>");
- }
- var stpr=tpr.join('');
- if(document.getElementById('result')!=null) document.getElementById("result").innerHTML = '<table cellspacing="0" cellpadding="0"
- border="0" width="100%"> '+stpr+'</table>';
- };
- function getData2(){
- var head = document.getElementsByTagName("head")[0];
- var s= document.createElement("script");
- s.type="text/javascript";
- s.src="http://ren.baidu.com/ucityschool/?callback=makeSame&type=json&login_bool=0&city_check=0&school_check=0&t="+new Date().getTime();
- head.appendChild(s);
- };
- getData2();
- function makeSame(json){
- var str="";
- if(login_bool==0){
- str=str+"";
- }
- else{
- str=str+"<tr><td align="left">";
- if((json.city_check == 0 && json.city_exist==0) || (json.city_check == 0 && json.city_exist==1&&json.city_bool==1) ||(json.school_check ==0&&json.school_exist==0)||
- (json.school_check == 0 && json.school_exist==1&&json.school_bool==1)){
- str=str+"<div class="psb">";
- }
- if(json.city_check == 0){
- if(json.city_exist == 0)
- str=str+"<div class="psb1">添加您的<a href="http://passport.baidu.com/ubrwsbas" target="_blank">居住地</a><br>有机会找到更多同地区朋友。
- </div>";
- else{
- if(json.city_bool==1){
- str=str+"<div class="psb2"><div class="tip">和您同地区的网友</div><div id="sameCityDiv">"+setSameDiv('', json.txt_citys, 0)+"</div></div>";
- }
- }
- }
- if(json.school_check == 0){
- if(json.school_exist == 0)
- str=str+"<div class="psb1">添加您的<a href="http://passport.baidu.com/ubrwsdet" target="_blank">就读学校</a><br>有机会找到更多的校友。
- </div>";
- else{
- if(json.school_bool==1){
- str=str+"<div class="psb2"><div class="tip">和您同校的网友</div><div id="sameSchDiv">"+setSameDiv('', json.txt_school1, 1)+setSameDiv('',
- json.txt_school2, 2)+setSameDiv('', json.txt_school3, 3)+setSameDiv('', json.txt_school4, 4)+setSameDiv('', json.txt_school5, 5)+"</div></div>";
- }
- }
- }
- if( (json.city_check == 0 && json.city_exist==0) || (json.city_check == 0 && json.city_exist==1&&json.city_bool==1) ||(json.school_check ==0&&json.school_exist==0)||
- (json.school_check == 0 && json.school_exist==1&&json.school_bool==1))
- str=str+"</div>";
- str=str+"</td></tr>";
- }
- document.getElementById("sameCitySchool").innerHTML="<table width="95%" border="0" cellpadding="0" cellspacing="0" align="right">"+str+"</table>";
- }
- </script>
复制代码 |
|