public void fetchOYPData() { this.logger.info("[{}]线程开始执行,欧亚盘指数..."); String year = DateUtils.formatDate(new Date(), "yyyy"); String content; try { String url = "http://www.cailele.com/lottery/dcspf/spfhomeAction.php?term="; String pContent = HttpUtil.getContentByURL(FetchConstant.CURPERIOD_URL, false); Pattern p4 = Pattern.compile(FetchConstant.CUR_PERIOD); Matcher m = p4.matcher(pContent); if (m.find()) { String period = year.substring(2, year.length()) + m.group(1).substring(1, m.group(1).length()); url = "http://www.cailele.com/lottery/dcspf/spfhomeAction.php?term=" + period; Log.info("==============【" + url + "】============"); } else { url = FetchConstant.OYP_URL; } content = HttpUtil.getContentByURL(url, false); // ArrayList datas = fiterOYPContent(content); // BuildOYPXMLDoc(datas); // } catch (JDOMException e) { // e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } this.logger.info("[{}]线程开始执行结束,欧亚盘指数..."); }
public void fetchData() { this.logger.info("[{}]线程开始执行,析亚欧..."); String content; try { content = HttpUtil.getContentByURL(FetchConstant.XYO_URL, false, "utf-8"); ArrayList datas = fiterContent(content); BuildXMLDoc(datas, "xyo.xml"); content = HttpUtil.getContentByURL(FetchConstant.SFCURL, false, "utf-8"); ArrayList sfcDatas = fiterContent(content); BuildXMLDoc(sfcDatas, "sfc_xyo.xml"); /*content = HttpUtil.getContentByURL(FetchConstant.BQCURL, false,"utf-8"); ArrayList bqcDatas = fiterContent(content); BuildXMLDoc(sfcDatas,"bqc_xyo.xml");*/ } catch (JDOMException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } this.logger.info("[{}]线程开始执行结束,析亚欧..."); }