アットウィキロゴ

p00h

package tv4;
 
import tool.*;
import java.io.*;
 
public class pro {
 
        int s,datanumber;
    String[] data=new String[600];
  String[] sta=new String[70000];
     String[][] memo=new String[70][100];
  int[][] card=new int[70][10];
  int[][] point=new int[70][10];
 
   String[] t=new String[700];
    String[] name=new String[70000];
    String[] xdate=new String[70000];
  String[] dic_sta=new String[7000000];
 
   String[] dic=new String[70000];
 
 
    public static void main(String[] args) {
        pro re=new pro();
    }
    pro(){
 
 
       readfile sub2=new readfile();
        sub2.makedata("tv.csv","UTF-8");
        data=sub2.data;
        datanumber=sub2.datanumber;
 
        for(s=2;s<datanumber+1;s++){
        String[] x=data[s].split(",");
        sta[s]=x[1];
        name[s]=x[4];
 
        }
 
 
        int sx,h,dicnumber=0;
 
for(s=2;s<datanumber+1;s++){
h=0;
 
for(sx=1;sx<dicnumber+1;sx++){    
if(name[s].equals(dic[sx]))h=100;
}
if(h<50)dicnumber=dicnumber+1;
if(h<50)dic[dicnumber]=name[s];
if(h<50)dic_sta[dicnumber]=sta[s];
 }
 
 
 
 for(s=1;s<dicnumber+1;s++){
 wiki sub3=new wiki();
 String w1=sub3.makedata(dic[s],dic_sta[s]);
 System.out.println(dic[s]+","+dic_sta[s]+","+w1);  
    }
 
 
 
 
 
    }
 
     void writexml(String file){ 
 
    int s,sx;
 
try{ 
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file))); 
 
for(s=1;s<datanumber+1;s++){     
}
 
 
 
System.out.println("ファイルに書きこみました。"); 
pw.close(); 
} catch(IOException ep){ System.out.println("入出力エラーです。"); } 
 
 
} 
 
 
 
}
 
 
package tv4;
 
import tool.*;
 
public class wiki{
int s,datanumber;
String[] data=new String[5000];
  String[] web=new String[5000];
 
 
 
    String makedata(String t1,String s1){
 
 
        String word=t1+" "+s1+" "+"site:ja.wikipedia.org/wiki/";
 
         makeutf sub6=new makeutf();
        String d=sub6.makedata(word);
 
 
        String urlx="https://www.bing.com/search?q="+d;
 
         getdata sub7=new getdata();
        sub7.makedata(urlx,"UTF-8");
        data=sub7.data;
        datanumber=sub7.datanumber; 
 
         String str="";
 for(s=1;s<datanumber+1;s++){
 
int h=0;  
if(data[s].indexOf("件の検索結果</span>")>-1)h=h+1;   
 if(data[s].indexOf("ja.wikipedia.org/")>-1)h=h+1; 
 if(h==2)str=data[s];
 }
 
  String de="";
String den="";
 
 String[] x=str.split(">");
 int sx=0;
 for(s=0;s<x.length;s++){
  if(x[s].indexOf("https://ja.wikipedia.org/wiki/")>-1)sx=sx+1;
 if(x[s].indexOf("https://ja.wikipedia.org/wiki/")>-1)web[sx]=x[s];
 }
 
 int number=sx;
 for(s=1;s<number+1;s++){
   int p1=web[s].indexOf("http");
   int p2=-1; 
  if(p1>-1) p2=web[s].indexOf("\"",p1);
    if(p2>-1) web[s]=web[s].substring(p1,p2);
    }
 
 String dem="";
 if(number>0)dem=web[1];
 
 return dem;
    }
 
    String change(String str){
 
        int n;
        for(n=1;n<501;n++){
        str=rev(str);    
        }
 
        str=str.replace(" ","");
 
        return str;
    }
 
 String rev(String str){
 
        if(str==null)str="";
 
        int p1=str.indexOf("<");
        int p2=-1;
        if(p1>-1)p2=str.indexOf(">",p1);
        String strx="";
        if(p2>-1)strx=str.substring(p1,p2+1);
        str=str.replace(strx,"");
 
        return str;
    }    
 
}
 
最終更新:2016年09月02日 20:41