package sana;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] web=new String[5000];
String[] namex=new String[5000];
String[] wiki=new String[5000];
String[] code=new String[5000];
int number;
String[] name9=new String[50000];
String[] code9=new String[50000];
public static void main(String[] args) {
pro r=new pro();
}
pro(){
readfile sub=new readfile();
sub.makedata("2016.csv","UTF-8");
data=sub.data;
datanumber=sub.datanumber;
for(s=2;s<datanumber+1;s++){
String[] x2=data[s].split(",");
namex[s-1]=x2[0];
wiki[s-1]=x2[1];
code[s-1]="";
if(x2.length>2) code[s-1]=x2[2];
}
number=datanumber-1;
readfile sub65=new readfile();
sub65.makedata("7.csv","UTF-8");
data=sub65.data;
datanumber=sub65.datanumber;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(",");
name9[s-1]=x[5];
code9[s-1]="";
if(x.length>9)code9[s-1]=x[9];
}
int tr;
for(tr=1;tr<datanumber;tr++){
String word=name9[tr];
int q1=word.indexOf("(");
if(q1>2)word=word.substring(0,q1);
q1=word.indexOf("[");
if(q1>2)word=word.substring(0,q1);
String w1=code9[tr];
if(code9[tr].length()<2){
w1=search(word);
}
if(w1.length()<1){
kadokawa sub4=new kadokawa();
sub4.number=number;
sub4.wiki=wiki;
sub4.code=code;
w1=sub4.makedata(word);
}
System.out.println(name9[tr]+","+w1);
}
}
String search(String word){
String[] name=new String[5000];
String[] id=new String[5000];
makeutf sub6=new makeutf();
String d=sub6.makedata(word);
int datanumber;
String urlx="http://movie.walkerplus.com/search/free_search.cgi?comkind=movie&keyword="+d;
getdata sub7=new getdata();
sub7.makedata(urlx,"UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
int s;
int sx=0;
for(s=1;s<datanumber+1;s++){
int h=0;
if(data[s].indexOf("com/mv")>-1)h=h+1;
if(data[s].indexOf("</h5>")>-1)h=h+1;
if(h==2) sx=sx+1;
if(h==2)name[sx]=data[s];
}
int number=sx;
for(s=1;s<number+1;s++){
int p1=name[s].indexOf("mv");
int p2=name[s].indexOf("/",p1);
id[s]=name[s].substring(p1,p2);
p1=name[s].indexOf(">",p1);
p2=name[s].indexOf("<",p1+1);
name[s]=name[s].substring(p1+1,p2);
}
String w1="";
if(number>0)w1=id[1];
return w1;
}
}
package sana;
import tool.*;
public class kadokawa {
int s,datanumber;
String[] data=new String[5000];
String[] web=new String[5000];
String[] namex=new String[5000];
String[] wiki=new String[5000];
String[] code=new String[5000];
int number;
String makedata(String word){
String w1=search(word);
word=word+" "+"WIKIPEDIA"+" "+"映画";
makeutf sub6=new makeutf();
String d=sub6.makedata(word);
String urlx="https://www.bing.com/search?q="+d;
getdata sub7=new getdata();
sub7.makedata(urlx,"UTF-8");
data=sub7.data;
datanumber=sub7.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[] x=str.split("</a>");
int sx=0;
for(s=0;s<x.length;s++){
if(x[s].indexOf("ja.wikipedia.org/")>-1)sx=sx+1;
if(x[s].indexOf("ja.wikipedia.org/")>-1)web[sx]=x[s];
}
int sp=sx;
String codex="";
if(web[1]==null)web[1]="";
int p1=web[1].indexOf("http");
int p2=web[1].indexOf("\"",p1);
if(p1>-1)web[s]=web[1].substring(p1,p2);
if(web[1].equals(wiki[sx]))codex=code[sx];
return codex;
}
String search(String word){
String[] name=new String[5000];
String[] id=new String[5000];
makeutf sub6=new makeutf();
String d=sub6.makedata(word);
int datanumber;
String urlx="http://movie.walkerplus.com/search/free_search.cgi?comkind=movie&keyword="+d;
getdata sub7=new getdata();
sub7.makedata(urlx,"UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
int s;
int sx=0;
for(s=1;s<datanumber+1;s++){
int h=0;
if(data[s].indexOf("com/mv")>-1)h=h+1;
if(data[s].indexOf("</h5>")>-1)h=h+1;
if(h==2) sx=sx+1;
if(h==2)name[sx]=data[s];
}
int number=sx;
for(s=1;s<number+1;s++){
int p1=name[s].indexOf("mv");
int p2=name[s].indexOf("/",p1);
id[s]=name[s].substring(p1,p2);
p1=name[s].indexOf(">",p1);
p2=name[s].indexOf("<",p1+1);
name[s]=name[s].substring(p1+1,p2);
}
String w1="";
if(number>0)w1=id[1];
return w1;
}
}
最終更新:2016年08月06日 07:58