package mov;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] name=new String[5000];
int number;
public static void main(String[] args) {
pro t=new pro();
}
pro(){
readfile sub4=new readfile();
sub4.makedata("data.csv","UTF-8");
data=sub4.data;
datanumber=sub4.datanumber;
for(s=2;s<datanumber+1;s++){
String[] y=data[s].split(",");
name[s]=y[1];
}
number=datanumber;
int tr;
for(tr=2;tr<number+1;tr++){
String word=name[tr]+" site:www.allcinema.net/prog";
makeutf sub6=new makeutf();
String d=sub6.makedata(word);
String urlx="https://www.bing.com/search?q=";
urlx=urlx+d;
getdata sub47=new getdata();
sub47.makedata(urlx,"UTF-8");
data=sub47.data;
datanumber=sub47.datanumber;
String ss="aria-label=\"検索結果";
String str="";
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf(ss)>-1)str=data[s];
}
String[] x=str.split(">");
String d2="http://www.allcinema.net/prog/show_c.php?num_c=";
String code="";
for(s=1;s<x.length;s++){
int h=0;
if(x[s].indexOf(d2)>-1)h=h+1;
if(code.length()<1)h=h+1;
if(h==2);
if(h==2)code=x[s];
}
int p1=code.indexOf("http");
int p2=code.indexOf("\"",p1);
if(p1>-1)code=code.substring(p1,p2);
System.out.println(name[tr]+","+code);
}
}
}
最終更新:2016年08月20日 19:25