package sjis;
import tool.*;
import java.util.HashMap;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] subdata=new String[5000];
String[] memo=new String[5000];
HashMap<String,String> map = new HashMap<String,String>();
public static void main(String[] args) {
pro t=new pro();
}
pro(){
readfile sub7=new readfile();
sub7.makedata("SJIS.csv","UTF-8");
data=sub7.data;
datanumber=sub7.datanumber;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(",");
String str="%"+x[2]+"%"+x[1];
map.put(x[0],str);
}
String w=makeword("伊集院光");
String urlx="http://www.oricon.co.jp/search/result.php?types=artist&search_string="+w+"&x=0&y=0";
getdata sub6=new getdata();
sub6.makedata(urlx,"SJIS");
data=sub6.data;
datanumber=sub6.datanumber;
int sx=0;
for(s=1;s<datanumber+1;s++){
int h=0;
if(data[s].indexOf("/prof/")>-1)h=h+1;
if(data[s].indexOf("ランキング")<1)h=h+1;
if(h==2) sx=sx+1;
if(h==2)memo[sx]=data[s];
}
for(s=1;s<sx+1;s++){
int p1=memo[s].indexOf("/prof/");
int p2=memo[s].indexOf("\"",p1);
memo[s]=memo[s].substring(p1,p2);
}
String id=memo[1];
System.out.println(id);
}
String search(String ch){
String w1="";
if(map.containsKey(ch))w1=map.get(ch);
return w1;
}
String makeword(String ww){
int s;
String k="";
for(s=0;s<ww.length();s++){
String d1=ww.substring(s,s+1);
k=k+search(d1);
}
return k;
}
}
最終更新:2016年08月11日 00:53