アットウィキロゴ

flvb

package plus;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import tool.*;
 
public class pro {
 
    int s,datanumber;
    String[] data=new String[5000];
  String[] subdata=new String[40000];
  String[] web=new String[500];  
 
    public static void main(String[] args) {
        pro t=new pro();
    }
    pro(){
 
        int tr;
        for(tr=2513;tr<2548;tr++){
 
        String urlx="http://dmate.blog99.fc2.com/blog-entry-"+tr+".html";
 
 
getdata sub=new getdata();
  sub.makedata(urlx,"UTF-8");
  data=sub.data;
  datanumber=sub.datanumber; 
 
 
 
  String str1="ently_title";
 
    int s1=0;
   for(s=1;s<datanumber+1;s++){
 if(data[s].indexOf(str1)>-1)s1=s;
   }
 
 
   int s2=0;
 
  for(s=s1;s<datanumber+1;s++){
  int h=0;
  if(data[s].indexOf("【日本テレビ】")>-1)h=h+1;
  if(s2==0)h=h+1;
  if(h==2)s2=s;
  }
 
 
 
   int sx=0;
   for(s=s1;s<s2+1;s++){
   sx=sx+1;
    subdata[sx]=data[s];
   }
 
 
   datanumber=sx;
 
 
   writexml("data/"+tr+".txt");
 
        }
 
    }
  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(subdata[s]); 
}
 
 
System.out.println("ファイルに書きこみました。"); 
pw.close(); 
} catch(IOException ep){ System.out.println("入出力エラーです。"); } 
 
 
} 
 
 
 
 
}
最終更新:2016年07月30日 23:16