package check;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[50000];
String[] link=new String[50000];
String[] web=new String[50000];
String[] name=new String[50000];
public static void main(String[] args) {
pro te=new pro();
}
pro(){
readfile sub7=new readfile();
sub7.makedata("d.csv","UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
for(s=1;s<datanumber+1;s++){
String[] z=data[s].split(",");
link[s]=z[1];
name[s]=z[0];
}
int number=datanumber;
String word="四季・奈津子"+" "+"WIKIPEDIA"+" "+"TBS"+" "+"テレビドラマ";
makeutf sub6=new makeutf();
String d=sub6.makedata(word);
String urlx="https://www.bing.com/search?q="+d;
getdata sub8=new getdata();
sub8.makedata(urlx,"UTF-8");
data=sub8.data;
datanumber=sub8.datanumber;
String str="";
for(s=1;s<datanumber+1;s++){
int h=0;
if(data[s].indexOf("件の検索結果</span>")>-1)h=h+1;
if(data[s].indexOf("ja.wikipedia.org/")>-1)h=h+1;
if(h==2)str=data[s];
}
String de="";
String den="";
String[] x=str.split(">");
int sx=0;
for(s=0;s<x.length;s++){
String[] y=x[s].split("<");
de=y[0];
if(y.length>1)den=y[1];
if(den.indexOf("ja.wikipedia.org/")>-1)sx=sx+1;
if(den.indexOf("ja.wikipedia.org/")>-1)web[sx]=den;
}
int sp=sx;
for(s=1;s<sp+1;s++){
System.out.println(web[s]);
}
}
String change(String str){
int n;
for(n=1;n<51;n++){
str=rev(str);
}
str=str.replace(" ","");
return str;
}
String rev(String str){
if(str==null)str="";
int p1=str.indexOf("<");
int p2=-1;
if(p1>-1)p2=str.indexOf(">",p1);
String strx="";
if(p2>-1)strx=str.substring(p1,p2+1);
str=str.replace(strx,"");
return str;
}
}
最終更新:2016年07月31日 16:42