アットウィキロゴ

お999g8

package movie;
 
import java.io.*;
import tool.*;
 
public class pro {
 
       int s,datanumber;
    String[] data=new String[360000];
     String[] namex=new String[5000000];
      String[] name=new String[500000];
 
    int[] year=new int[5000000];
    int[] month=new int[5000000];
    int[] day=new int[5000000];
    String[] th=new String[5000000];
    String[] v1=new String[5000000];
    String[] v2=new String[5000000];
    String[] v3=new String[5000000];
     String[] time=new String[5000000];
     String[] code=new String[50000];
   String[] code_name=new String[50000];
  String[] id=new String[50000];
   String[] id_name=new String[50000];
  String[] gid=new String[50000];
    String[] gid_name=new String[50000];
 
    public static void main(String[] args) {
       pro te=new pro();
    }
    pro(){
 
    readx("mov.csv");
 
      for(s=2;s<datanumber+1;s++){
 
          String[] x=data[s].split(",");
 
        name[s]=x[5];
        namex[s]=name[s];
        year[s]=numx(x[0]);
        month[s]=numx(x[1]);
        day[s]=numx(x[2]);
        th[s]=x[4];
        v1[s]=x[6];
        v2[s]=x[7];
        v3[s]=x[8];
        time[s]=x[3];
        }
 
 
for(s=2;s<datanumber+1;s++){
  int p1=namex[s].indexOf("(");
  if(p1>0)namex[s]=namex[s].substring(0,p1);     
  p1=namex[s].indexOf("(");
  if(p1>0)namex[s]=namex[s].substring(0,p1);     
  p1=namex[s].indexOf("(");
  if(p1>0)namex[s]=namex[s].substring(0,p1);   
  p1=namex[s].indexOf("(");
  if(p1>0)namex[s]=namex[s].substring(0,p1);     
  p1=namex[s].indexOf("[");
  if(p1>0)namex[s]=namex[s].substring(0,p1);
 p1=namex[s].indexOf("【");
 if(p1>0)namex[s]=namex[s].substring(0,p1);
 
   p1=namex[s].indexOf("(");
 if(p1>5)namex[s]=namex[s].substring(0,p1);
 p1=namex[s].indexOf("(");
 int p2=namex[s].indexOf(")",p1);
 if(p1==0)namex[s]=namex[s].substring(p2+1,namex[s].length());
 namex[s]=namex[s].replace("(字幕版)","");
 namex[s]=namex[s].replace("(日本語吹替版)","");
 namex[s]=namex[s].replace("(3D・字幕版)","");
 namex[s]=namex[s].replace("3D字幕IMAX","");
 namex[s]=namex[s].replace("(3D・日本語吹替版)","");
 namex[s]=namex[s].replace("<4Kデジタル復元版>","");
 namex[s]=namex[s].replace("トークショー付上映","");
 namex[s]=namex[s].replace("≪応援上映≫","");
 namex[s]=namex[s].replace("3D4DX","");
 namex[s]=namex[s].replace("3D","");
 namex[s]=namex[s].replace("[舞台挨拶中継]","");
 namex[s]=namex[s].replace("[中継]","");
 namex[s]=namex[s].replace("吹替","");
 namex[s]=namex[s].replace("イベント付上映","");
 namex[s]=namex[s].replace("【舞台挨拶中継付先行】","");
 namex[s]=namex[s].replace("[舞台挨拶中継先行/]","");
 namex[s]=namex[s].replace("【字幕2D】","");
 namex[s]=namex[s].replace("【字幕】","");
 namex[s]=namex[s].replace("【字幕付】","");
 namex[s]=namex[s].replace("【】","");
  namex[s]=namex[s].replace("【舞台挨拶付先行上映会】","");
  namex[s]=namex[s].replace("【イベント】","");
   namex[s]=namex[s].replace("【舞台挨拶付】","");
  namex[s]=namex[s].replace("4DX","");
   namex[s]=namex[s].replace("【2D・日本語字幕付】","");
   namex[s]=namex[s].replace("[初日舞台挨拶]","");
    namex[s]=namex[s].replace("【公開記念舞台挨拶】","");
     namex[s]=namex[s].replace("【大ヒット舞台挨拶】","");
    namex[s]=namex[s].replace("【字幕HFR】","");
     namex[s]=namex[s].replace("(イベント上映)","");
     namex[s]=namex[s].replace("【握手会付】","");
     namex[s]=namex[s].replace("【冬休み直前舞台挨拶】","");
     namex[s]=namex[s].replace("【舞台挨拶先行】","");
     namex[s]=namex[s].replace("プレミア先行上映","");
      namex[s]=namex[s].replace("2D","");
      namex[s]=namex[s].replace("プレミア先行上映","");
      namex[s]=namex[s].replace("ATMOS","");
     namex[s]=namex[s].replace("字幕","");
      namex[s]=namex[s].trim();
  }
 
 
 
        int dicnumber=0;
        String[] dic=new String[50000];
        int sx;
   for(s=2;s<datanumber+1;s++){
   int h=0;   
  for(sx=1;sx<dicnumber+1;sx++){
  if(namex[s].equals(dic[sx]))h=100;
  }
  if(h<50)dicnumber=dicnumber+1;
  if(h<50)dic[dicnumber]=namex[s];
  }
 
for(s=1;s<dicnumber+1;s++){
 bing sub5=new bing();
 code[s]=sub5.makedata(dic[s]);
 
 code_name[s]="";
 if(code[s].length()>1){
 check sub6=new check();
 code_name[s]=sub6.makedata(code[s]);
 }
 
 wiki sub21=new wiki();
 String w1=sub21.makedata(dic[s]);
 
 wiki sub22=new wiki();
 String w2=sub22.makedata(code_name[s]);
 int h=0;
 if(w1.equals(w2))h=100;
 id[s]="";
 if(h>50)id[s]=code[s];
 id_name[s]=code_name[s];
 System.out.println(s+","+dic[s]+","+code[s]);
 }
 
  for(s=2;s<datanumber+1;s++){
  gid[s]="";
  gid_name[s]="";
  for(sx=1;sx<dicnumber+1;sx++){
  if(namex[s].equals(dic[sx]))gid[s]=id[sx];
  if(namex[s].equals(dic[sx]))gid_name[s]=id[sx];
  }
  }
 
 writexml("ren.csv");
 
 
    }
 
     void writexml(String file){ 
 
    int s,sx;
 
try{ 
PrintWriter pw = new PrintWriter (new BufferedWriter(new FileWriter(file))); 
 
pw.println("y,m,d,t,th,n,v1,v2,v3,code,name"); 
for(s=2;s<datanumber+1;s++){   
pw.print(year[s]); 
pw.print(",");
pw.print(month[s]); 
pw.print(",");
pw.print(day[s]); 
pw.print(",");
pw.print(time[s]); 
pw.print(",");
pw.print(th[s]); 
pw.print(",");
pw.print(name[s]); 
pw.print(",");
pw.print(v1[s]);
pw.print(",");
pw.print(v2[s]);
pw.print(",");
pw.print(v3[s]);
pw.print(",");
pw.print(gid[s]);
pw.print(",");
pw.println(gid_name[s]);
}
 
 
 
System.out.println("ファイルに書きこみました。"); 
pw.close(); 
} catch(IOException ep){ System.out.println("入出力エラーです。"); } 
 
 
} 
 
 
 
 
    String search(String word){
 
 
         String[] name=new String[5000];
      String[] id=new String[5000];
 
     makeutf sub6=new makeutf();
        String d=sub6.makedata(word);
 
 int datanumber;
 
        String urlx="http://movie.walkerplus.com/search/free_search.cgi?comkind=movie&keyword="+d;
 
         getdata sub7=new getdata();
        sub7.makedata(urlx,"UTF-8");
        data=sub7.data;
        datanumber=sub7.datanumber; 
 
        int s;
 
        int sx=0;
        for(s=1;s<datanumber+1;s++){
            int h=0; 
            if(data[s].indexOf("com/mv")>-1)h=h+1;
            if(data[s].indexOf("</h5>")>-1)h=h+1;
            if(h==2)    sx=sx+1;
        if(h==2)name[sx]=data[s];
 
        }
 
   int number=sx;
 
 
         for(s=1;s<number+1;s++){
         int p1=name[s].indexOf("mv");
         int p2=name[s].indexOf("/",p1);
         id[s]=name[s].substring(p1,p2);
         p1=name[s].indexOf(">",p1);
         p2=name[s].indexOf("<",p1+1);
         name[s]=name[s].substring(p1+1,p2);
 
          }
 
         String w1="";
         if(number>0)w1=id[1];
 
    return w1;
 
 
}
        int numx(String str){
 
    int nx;
 
    nx=0;
 
 try{
 
    nx=Integer.parseInt(str);
 
 }catch (Exception e) {}
 
 return nx;
 
 
 
} 
 
  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 movie;
 
import tool.*;
 
public class wiki {
 
    int s,datanumber;
    String[] data=new String[6000];
 
 
 
 
    String makedata(String w2){
 
        String word=w2+" site:ja.wikipedia.org/wiki/";
 
        makeutf sub6=new makeutf();
        String d=sub6.makedata(word);
 
 
           String urlx="https://www.bing.com/search?q=";
           urlx=urlx+d;
 
 
        getdata sub7=new getdata();
        sub7.makedata(urlx,"UTF-8");
        data=sub7.data;
        datanumber=sub7.datanumber; 
 
        String ss="aria-label=\"検索結果";
 
        String str="";
 
        for(s=1;s<datanumber+1;s++){
 
        if(data[s].indexOf(ss)>-1)str=data[s];
 
        } 
 
 
 
 
         String[] x=str.split(">");
 
        String d2="https://ja.wikipedia.org/wiki/";
        String pp="";
 
        String[] ps=new String[500];
 
        int sx=0;
     for(s=0;s<x.length;s++){   
     int h=0;
    if(x[s].indexOf(d2)>-1)h=h+1;
     if(h==1)sx=sx+1;
    if(h==1)ps[sx]=x[s];
 
     }
 int number=sx; 
 
 
     String delta="";
 if(number>0)delta=ps[1];
 
 int p1=delta.indexOf("http");
 int p2=delta.indexOf("\"",p1);
 
 if(p1>-1)delta=delta.substring(p1,p2);
 
 return delta;
 
 
 
    }   }
 
 
package movie;
 
 
import tool.*;
 
public class bing {
 
    int s,datanumber;
    String[] data=new String[6000];
 
 
 
 
    String makedata(String ww){
 
        String word=ww+" site:movie.walkerplus.com/";
 
        makeutf sub6=new makeutf();
        String d=sub6.makedata(word);
 
 
           String urlx="https://www.bing.com/search?q=";
           urlx=urlx+d;
 
 
        getdata sub7=new getdata();
        sub7.makedata(urlx,"UTF-8");
        data=sub7.data;
        datanumber=sub7.datanumber; 
 
        String ss="aria-label=\"検索結果";
 
        String str="";
 
        for(s=1;s<datanumber+1;s++){
 
        if(data[s].indexOf(ss)>-1)str=data[s];
 
        } 
 
        String[] x=str.split(">");
 
        String d2="movie.walkerplus.com/mv";
        String pp="";
 
     for(s=0;s<x.length;s++){   
     int h=0;
    if(x[s].indexOf(d2)>-1)h=h+1;
    if(pp.length()==0)h=h+1;
    if(h==2)pp=x[s];
    }
 
    int p1=pp.indexOf("/mv");
    int p2=pp.indexOf("/",p1+1);
    if(p1>-1)pp=pp.substring(p1+1,p2); 
 
 return pp;
 
 
 
    }
 
    }
 
 
package movie;
 
 
import tool.getdata;
 
 
public class check {
 
     int s,datanumber;
    String[] data=new String[6000];
 
String makedata(String d2){
 
    String urlx="http://movie.walkerplus.com/"+d2+"/";
 
     getdata sub7=new getdata();
        sub7.makedata(urlx,"UTF-8");
        data=sub7.data;
        datanumber=sub7.datanumber; 
 
 
        String ss="aria-label=\"検索結果";
 
        String kk="";
 
        for(s=1;s<datanumber+1;s++){
 if(data[s].indexOf("<title>")>-1)kk=data[s];
 
        } 
 
        kk=kk.replace("| Movie Walker</title>","");
        kk=kk.replace("<title>","");
 
        return kk;
 
            }
 
}
 
最終更新:2016年08月30日 02:22