天气预报

fashchina 2006-09-15 10:38:39
谁有比较好的、稳定的天气预报的代码
要求能获得三天以上的天气预报

贴代码
...全文
600 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
dyw31415926 2007-01-05
  • 打赏
  • 举报
回复
mark
mr_liyf 2007-01-05
  • 打赏
  • 举报
回复
是呢
zsvjavaandjava1 2006-11-10
  • 打赏
  • 举报
回复

<%@ page contentType="text/html; charset=gbk" language="java"%>

<%@ page
import="java.net.*,java.io.*,cn.com.runbest.lnmz.termmanage.TermManageDAO,java.util.regex.*"%>
<%

URL url = new URL("http://weather.cn.yahoo.com/area.html?city=大连");

StringBuffer sb = new StringBuffer();

InputStreamReader isr = new InputStreamReader(url.openStream(),
"GB2312");


int ic = 0;
while ((ic = isr.read()) != -1) {
sb.append((char) ic);
}
isr.close();
}

String qw = sb.toString();

Matcher m = Pattern
.compile(
"(?:<td width=\"33%\" class=\"line1\">\\n)(<table.*\\n(.*\\n)*?.*table>\\n)")
.matcher(qw);

whhile (m.find()) {

String tempgroup = "<MARQUEE onmouseover=this.stop(); onmouseout=this.start(); scrollamount=3 direction=up height=120>";
tempgroup = tempgroup + m.group(1);

tempgroup = tempgroup.replaceAll("width=\"100%\"",
"width=\"80%\" align=\"center\"");

tempgroup = tempgroup
.replaceAll(
"<td width=\"20\" align=\"center\" bgcolor=\"#ccccff\">",
"");

tempgroup = tempgroup.replaceAll("<b>", "");
//tempgroup = tempgroup.replaceAll("今","");

tempgroup = tempgroup.replaceAll("<br>", "");

//tempgroup = tempgroup.replaceAll("天","");

tempgroup = tempgroup.replaceAll("</b>", "");

tempgroup = tempgroup.replaceAll("</td>", "");

//tempgroup = tempgroup.replaceAll("<td align=\"center\"><img src=\"http://cn.yimg.com/i/we/b/3.gif\" width=\"52\" height=\"52\" align=\"absmiddle\">","");

//tempgroup = tempgroup.replaceAll("<b>","");
//tempgroup = tempgroup.replaceAll("多云","");
tempgroup = tempgroup.replaceAll("</b></td>", "");
tempgroup = tempgroup.replaceAll("</tr>", "");
// tempgroup = tempgroup.replaceAll("100","20");
tempgroup = tempgroup.replaceAll("pad1 yge", "black");

tempgroup = tempgroup + "</MARQUEE>";

%>

<%=tempgroup%>

<%}


代码大概就这样, 中间的一些 replaceAll 是我自己调格式时候用的,可以自己改一下,

(这个代码也是高手给我的, 我修改了的 高手的名字叫 DreamOver )
harryzyp 2006-10-17
  • 打赏
  • 举报
回复
这种代码可能没人提供,关注.......... 偷到的兄弟告诉大家一声哦,呵呵
fashchina 2006-10-17
  • 打赏
  • 举报
回复
要成熟的代码或者rss输出
xx_jj 2006-10-17
  • 打赏
  • 举报
回复
gz
xiefang1017 2006-10-17
  • 打赏
  • 举报
回复
有点难度,关注中1
!
liujin2005 2006-10-09
  • 打赏
  • 举报
回复
代码如何写?
怎样偷
sunangle 2006-10-09
  • 打赏
  • 举报
回复
QQ的不错
大选 2006-10-09
  • 打赏
  • 举报
回复
我还是建议偷。除非你
自己架设卫星。
abrwang 2006-10-08
  • 打赏
  • 举报
回复
路过
shine333 2006-10-08
  • 打赏
  • 举报
回复
just an idea, there must be sth usable in RSS format
fashchina 2006-10-08
  • 打赏
  • 举报
回复
up
yougucao379548695 2006-09-26
  • 打赏
  • 举报
回复
想了解下!
Javafan0 2006-09-26
  • 打赏
  • 举报
回复
up
fashchina 2006-09-26
  • 打赏
  • 举报
回复
up
loveyt 2006-09-21
  • 打赏
  • 举报
回复
OnlyFor_love(『光在哪里 荣耀就在哪里』) ( ) 信誉:131 Blog 2006-9-15 16:56:13 得分: 0

小偷程序 偷新浪的 比较稳定

--------------------------------------------

借用好伐```````````



fashchina 2006-09-21
  • 打赏
  • 举报
回复
up
fashchina 2006-09-18
  • 打赏
  • 举报
回复
你们用的比较多的就行
helloMoney 2006-09-15
  • 打赏
  • 举报
回复
只有自己写
加载更多回复(11)

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧