import java.io.*;
class game{
String[] data=new String[100];
String urlx,file;
String str,bun;
int page,s,sx,datanumber;
int t,dlong;
public static void main(String [] args) {
game test=new game();
}
game(){
t=0;
for (page=1;page<2;page++){
file="gdata/";
file=file+page;
file=file+".txt";
readfile(file);
for(s=1;s<datanumber+1;s++){
dlong=data[s].length();
str=data[s].substring(1,dlong-1);
System.out.println(str);
urlx="http://logsoku.com/";
urlx=urlx+str;
getdata g=new getdata();
g.makedata(urlx);
bun=g.data;
t=t+1;
file="memo/";
file=file+t;
file=file+".txt";
writefile(file);
}
}
}
void writefile(String file){
try{
PrintWriter pw = new PrintWriter
(new BufferedWriter(new FileWriter(file)));
pw.println(bun);
System.out.println("ファイルに書きこみました。");
pw.close();
}
catch(IOException ep){ System.out.println("入出力エラーです。"); }
}
void readfile(String file){
int s;
String str;
BufferedReader br;
s=0;
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"SJIS"));
while((str = br.readLine()) != null) {
s=s+1;
data[s]=str;
}
br.close();
} catch (IOException e) {System.out.println(e);}
datanumber=s;
}
}
最終更新:2011年07月06日 06:44