package bing;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class pro {
String[][] name=new String[200][20];
int s,datanumber;
String[] data=new String[200];
int number;
public static void main(String[] args) {
pro te=new pro();
}
pro(){
readx("72.csv");
int sx;
for(s=2;s<datanumber+1;s++){
String[] x=data[s].split(",");
for(sx=0;sx<x.length;sx++){
name[sx+1][s-1]=x[sx];
}
number=x.length;
}
for(s=1;s<number+1;s++){
for(sx=1;sx<11;sx++){
bing sub=new bing();
String v1=sub.makedata(name[s][sx]);
check sub2=new check();
String v2=sub2.makedata(v1);
System.out.println((s+2008)+","+sx+","+name[s][sx]+","+v1+","+v2);
}}
}
void readx(String file){
String str;
BufferedReader br;
int s;
s=0;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
while((str = br.readLine()) != null) {
s=s+1;
data[s]=str;
}
br.close();
} catch (IOException e) {System.out.println(e);}
datanumber=s;
}
}
package bing;
import tool.*;
public class bing {
int s,datanumber;
String[] data=new String[6000];
String makedata(String w2){
String word=w2+" site:oricon.co.jp/prof/";
makeutf sub6=new makeutf();
String d=sub6.makedata(word);
String urlx="https://www.bing.com/search?q=";
urlx=urlx+d;
getdata sub7=new getdata();
sub7.makedata(urlx,"UTF-8");
data=sub7.data;
datanumber=sub7.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.oricon.co.jp/";
String pp="";
String[] ps=new String[500];
int sx=0;
for(s=0;s<x.length;s++){
int h=0;
if(x[s].indexOf(d2)>-1)h=h+1;
if(x[s].indexOf("/prof/")>-1)h=h+1;
if(h==2)sx=sx+1;
if(h==2)ps[sx]=x[s];
}
int number=sx;
for(s=1;s<number+1;s++){
int p1=ps[s].indexOf("http");
int p2=-1;
if(p1>-1)p2=ps[s].indexOf("\"",p1);
if(p2>-1)ps[s]=ps[s].substring(p1,p2);
}
String delta="";
String mm="";
for(s=1;s<number+1;s++){
ps[s]=ps[s].replace("/artist","");
int p1=ps[s].indexOf("prof/");
p1=ps[s].indexOf("/",p1);
int p2=ps[s].indexOf("/",p1+1);
if(p2>-1)mm=ps[s].substring(p1+1,p2);
int h=0;
if(delta.length()<1)h=h+1;
if(mm.length()>2)h=h+1;
if(h==2)delta=mm;
}
return delta;
} }
package bing;
import tool.getdata;
public class check {
int s,datanumber;
String[] data=new String[6000];
String makedata(String gid){
String urlx="http://www.oricon.co.jp/prof/";
urlx=urlx+gid+"/";
getdata sub7=new getdata();
sub7.makedata(urlx,"SJIS");
data=sub7.data;
datanumber=sub7.datanumber;
String de="";
for(s=1;s<datanumber+1;s++){
if(data[s].indexOf("artist-link")>-1)de=data[s];
}
int p1=de.indexOf(">");
int p2=de.indexOf("<",p1);
if(p1>-1)de=de.substring(p1+1,p2);
return de;
}
}
最終更新:2016年08月31日 06:07