帮美女老婆收集基金行情 Java程序
2007-07-28 14:14
295 查看
最近,加息减税后,基金股票行情火爆,美女老婆趋之若渴,每天必上“天天基金网”翻查。她抱怨行数太多了,字体又小。作为心疼本本的我,最怕这些女人乱点广告让机器中“熊猫烧香”之类网页毒。于是我灵机一动,从网页搜查出关键字,然后过滤重新拼成固定的html,再到桌面做快捷方式,每天开机自动运行。哈哈,果然博得美人瓜瓜直叫“你太有才啦!”
与大家分享一下代码:
import java.net.URL;
import java.net.URLConnection;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
public class URLReader ...{
public static void main(String[] args) throws Exception ...{
String _findstr1 = "广发聚丰基金";
String _findstr2 = "广发小盘基金";
String _findstr3 = "中小板基金";
String _findstr4 = "易基价值精选基金";
URLConnection yc = (new URL("http://funds.eastmoney.com/"))
.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc
.getInputStream()));
String inputLine;
File out = new File("aaa.html");
FileWriter fw = new FileWriter(out);
PrintWriter pw = new PrintWriter(fw);
String str = "爱丹丹版1.0<br><table align="center" width="914" border="1" cellspacing="0" cellpadding="2" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">";
pw.print(str);
while ((inputLine = in.readLine()) != null) ...{
if (((inputLine.indexOf(_findstr1)) > 0)
|| ((inputLine.indexOf(_findstr2)) > 0)
|| ((inputLine.indexOf(_findstr3)) > 0)
|| ((inputLine.indexOf(_findstr4)) > 0)) ...{
inputLine = inputLine.substring(inputLine
.indexOf("<tr height=20>"));
pw.print(inputLine);
inputLine = in.readLine();
inputLine = inputLine.substring(0, inputLine
.indexOf("<tr height=20>"));
pw.print(inputLine);
}
}
in.close();
fw.close();
}
}
这个代码的优点就是短小精巧.(哈哈,王婆卖瓜), 缺点就是赋值都是固定的,成了私家专用程序了,想盗版都难啊! 希望朋友你也能用这个逗逗你的心上人吧 :)
与大家分享一下代码:
import java.net.URL;
import java.net.URLConnection;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
public class URLReader ...{
public static void main(String[] args) throws Exception ...{
String _findstr1 = "广发聚丰基金";
String _findstr2 = "广发小盘基金";
String _findstr3 = "中小板基金";
String _findstr4 = "易基价值精选基金";
URLConnection yc = (new URL("http://funds.eastmoney.com/"))
.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc
.getInputStream()));
String inputLine;
File out = new File("aaa.html");
FileWriter fw = new FileWriter(out);
PrintWriter pw = new PrintWriter(fw);
String str = "爱丹丹版1.0<br><table align="center" width="914" border="1" cellspacing="0" cellpadding="2" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">";
pw.print(str);
while ((inputLine = in.readLine()) != null) ...{
if (((inputLine.indexOf(_findstr1)) > 0)
|| ((inputLine.indexOf(_findstr2)) > 0)
|| ((inputLine.indexOf(_findstr3)) > 0)
|| ((inputLine.indexOf(_findstr4)) > 0)) ...{
inputLine = inputLine.substring(inputLine
.indexOf("<tr height=20>"));
pw.print(inputLine);
inputLine = in.readLine();
inputLine = inputLine.substring(0, inputLine
.indexOf("<tr height=20>"));
pw.print(inputLine);
}
}
in.close();
fw.close();
}
}
这个代码的优点就是短小精巧.(哈哈,王婆卖瓜), 缺点就是赋值都是固定的,成了私家专用程序了,想盗版都难啊! 希望朋友你也能用这个逗逗你的心上人吧 :)
相关文章推荐
- Java实现利用搜索引擎收集网址的程序
- Java实现利用搜索引擎收集网址的程序-Java基础-Java-编程开发
- (转)Java实现利用搜索引擎收集网址的程序
- java面试程序题收集
- Java实现利用搜索引擎收集网址的程序
- 如何用Java实现利用搜索引擎收集网址的程序
- 一个java swt桌面程序开发到打包的总结(1)(收集)
- JAVA课程设计_CSDN博客收集和整理程序_数据库连接类
- Java实现利用搜索引擎收集网址的程序
- Java实现利用搜索引擎收集网址的程序
- java面试程序题收集
- Java实现利用搜索引擎收集网址的程序
- Java实现利用搜索引擎收集网址的程序
- 怎么实现利用Java搜索引擎收集网址的程序
- Java实现利用搜索引擎收集网址的程序
- Java实现利用搜索引擎收集网址的程序
- 收集的20个非常有用的Java程序片段
- 福利贴——爬取美女图片的Java爬虫小程序代码
- java程序启动参数设置优化_分代收集算法
- 编写JAVA程序收集Tomcat性能数据