package table;
import java.io.*;
public class pro {
int s,datanumber;
String[] data=new String[5000];
String[] name=new String[5000];
String[] code=new String[5000];
String[] imx=new String[5000];
public static void main(String[] args) {
pro r=new pro();
}
pro(){
search_all sub=new search_all();
sub.makedata("1GBbdgpYa5fc4XJCOrHQ1r3jc6QVO6FRm6j8W0BQn");
name=sub.name;
code=sub.code;
for(s=1;s<201;s++){
pic sub2=new pic();
String c=sub2.makedata(code[s]);
imx[s]="<img src=\""+c+"\">";
System.out.println(imx[s]);
}
readx("ren.html");
String str1="<table>";
for(s=1;s<26;s++){
str1=str1+"<tr><td>"+s+"</td>";
str1=str1+"<td>"+name[s]+"</td>";
str1=str1+"<td>"+imx[s]+"</td>";
str1=str1+"</tr>";
}
str1=str1+"</table>";
String str2="<table>";
for(s=1;s<26;s++){
str2=str2+"<tr><td>"+s+"</td>";
str2=str2+"<td>"+name[s+25]+"</td>";
str2=str2+"<td>"+imx[s+25]+"</td>";
str2=str2+"</tr>";
}
str2=str2+"</table>";
String str3="<table>";
for(s=1;s<26;s++){
str3=str3+"<tr><td>"+s+"</td>";
str3=str3+"<td>"+name[s+50]+"</td>";
str3=str3+"<td>"+imx[s+50]+"</td>";
str3=str3+"</tr>";
}
str3=str3+"</table>";
String str4="<table>";
for(s=1;s<26;s++){
str4=str4+"<tr><td>"+s+"</td>";
str4=str4+"<td>"+name[s+75]+"</td>";
str4=str4+"<td>"+imx[s+75]+"</td>";
str4=str4+"</tr>";
}
str4=str4+"</table>";
for(s=1;s<datanumber+1;s++){
data[s]=data[s].replace("a1a1",str1);
data[s]=data[s].replace("a2a2",str2);
data[s]=data[s].replace("a3a3",str3);
data[s]=data[s].replace("a4a4",str4);
}
writexml("a.html");
}
void writexml(String file){
int s,sx;
try{
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file)));
for(s=1;s<datanumber+1;s++){
pw.println(data[s]);
}
System.out.println("ファイルに書きこみました。");
pw.close();
} catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
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 table;
import tool.*;
public class search_all {
int s,datanumber;
String[] data=new String[5000];
String[] code=new String[5000];
String[][] namex=new String[50][50];
String[] name=new String[5000];
String[] year=new String[5000];
String[] r=new String[5000];
void makedata(String id){
String str1="%20";
String urlx="https://www.googleapis.com/fusiontables/v1/query?sql=SELECT";
urlx=urlx+str1+"*"+str1+"FROM"+str1+id;
urlx=urlx+"&key=AIzaSyAH0WCAXRIdHdbI-6bnMSN4kVDDZZmGyqY";
getdata sub=new getdata();
sub.makedata(urlx,"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
String str="";
for(s=1;s<datanumber+1;s++){
str=str+data[s];
}
int p1=str.indexOf("rows");
p1=str.indexOf(":",p1);
str=str.substring(p1,str.length());
int sx;
int tx=0;
String[] x=str.split("],");
for(s=0;s<x.length;s++){
String[] y=x[s].split(",");
for(sx=0;sx<y.length;sx++){
if(sx==0)year[s+1]=cg(y[sx]);
if(sx==1)r[s+1]=cg(y[sx]);
if(sx==3)name[s+1]=cg(y[sx]);
if(sx==2)code[s+1]=cg(y[sx]);
}
System.out.println(x[s]);
}
}
String cg(String c){
int p1=c.indexOf("\"");
int p2=c.indexOf("\"",p1+1);
c=c.substring(p1+1,p2);
return c;
}
}
package table;
import tool.*;
import java.io.File;
public class pic {
int s,datanumber;
String[] data=new String[40000];
String[] link=new String[40000];
String[] name=new String[40000];
String[] music=new String[40000];
String makedata(String code){
String urlx="http://www.oricon.co.jp/prof/"+code+"/";
getdata sub2=new getdata();
sub2.makedata(urlx,"SJIS");
data=sub2.data;
datanumber=sub2.datanumber;
String date="artist-introduction-pic";
String str="";
int s1=1;
for(s=1;s<datanumber;s++){
if(data[s].indexOf(date)>-1)str=data[s];
}
int p1=str.indexOf("http://contents.oricon.co");
int p2=-1;
if(p1>-1)p2=str.indexOf("\"",p1);
if(p1>-1)str=str.substring(p1,p2);
return str;
}
String change(String str){
int n;
for(n=1;n<11;n++){
str=rev(str);
}
str=str.replace(" ","");
return str;
}
String rev(String str){
if(str==null)str="";
int p1=str.indexOf("<");
int p2=str.indexOf(">",p1);
String strx="";
if(p2>-1)strx=str.substring(p1,p2+1);
str=str.replace(strx,"");
return str;
}
}
最終更新:2016年09月11日 01:49