アットウィキロゴ

rinki wiki

package tv5;
 
import tool.*;
 
public class pro {
int s,datanumber;
String[] data=new String[5000];
  String[] web=new String[5000];
 
    public static void main(String[] args) {
        pro t=new pro();
    }
 
    pro(){
 
 
        String word="20世紀解体新書"+" "+"TBS"+" "+"WIKIPEDIA";
 
         makeutf sub6=new makeutf();
        String d=sub6.makedata(word);
 
        System.out.println(d);
 
        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("ja.wikipedia.org/")>-1)sx=sx+1;
 if(x[s].indexOf("ja.wikipedia.org/")>-1)web[sx]=x[s];
 }
 
 int number=sx;
 for(s=1;s<number+1;s++){
   int p1=web[s].indexOf("http");
     int p2=web[s].indexOf("\"",p1);
     web[s]=web[s].substring(p1,p2);
     System.out.println(web[s]);
    }
 
 
 
 
    }
 
    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年08月10日 01:23