@@ -0,0 +1,1386 @@
+package page;%0A%0Aimport structure.News;%0Aimport net.HttpPage;%0A%0A%0Apublic class NewsPage %7B%0A%09%0A%09private final String CODE_MODE = %22euc-jp%22;%0A%0A%09public News getNews(String url)%7B%0A%09%09News news = new News();%0A%09%09%0A%09%09HttpPage.CODE_MODE = CODE_MODE;%0A%09%09String page_content = HttpPage.getPageSource(url);%0A%09%09%0A%09%09//get title%0A%09%09String titleStartString = %22yjXL%5C%22%3E%22;%0A%09%09int titleStartIndex = page_content.indexOf(titleStartString) + titleStartString.length();%0A%09%09int titleEndIndex = page_content.indexOf('%3C', titleStartIndex);%0A%09%09String title = page_content.substring(titleStartIndex, titleEndIndex);%0A%09%09%0A%09%09//get text%0A%09%09String text = %22%22;%0A%09%09String startString = %22ynDetailText%5C%22%3E%22;%0A%09%09String endString   = %22%3C/div%3E%22;%0A%09%09int startIndex ,endIndex = titleEndIndex;%0A%09%09%0A%09%09while(true)%7B%0A%09%09%09startIndex = page_content.indexOf(startString,endIndex);%0A%09%09%09if(startIndex == -1)%7B%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09startIndex += startString.length();%0A%09%09%09endIndex = page_content.indexOf(endString,startIndex);%0A%09%09%09text += page_content.substring(startIndex,endIndex);%0A%09%09%7D%0A%09%09//replace %3C/p%3E%0A%09%09text = text.replace(%22%3C/p%3E%22, %22%5BENTER%5D%22);%0A%09%09%0A%09%09//replace %3Cbr%3E%0A%09%09text = text.replaceAll(%22%3Cbr%5C%5Cs*%5B/%5D?%5C%5Cs*%3E%22, %22%5BENTER%5D%22);%0A%09%09%0A%09%09//remove &1234;%0A%09%09text = text.replaceAll(%22&.%7B4%7D;%22,%22%22);%0A%09%09%0A%09%09//remove %3C*%3E%0A%09%09text = text.replaceAll(%22%3C%5B%5E%3E%5D+%3E%22, %22%22);%0A%09%09%0A%09%09//remove enter key%0A%09%09text = text.replace(%22%5Cn%22,%22%22);%0A%09%09%0A%09%09news.setTitle(title);%0A%09%09news.setText(text);%0A%09%09return news;%0A%09%7D%0A%09%0A%7D%0A

Create NewsPage.java