The improved auto-show weather forecast applet (both in Linux and Windows environments)

Source: Internet
Author: User
This improvement mainly adds image acquisition and provides a complete function for obtaining remote files. The code is as follows :? $ Fcontfile (www.bjmb.gov. cntoday. asp); $ arrarray (); for ($ i0; $ icount ($ fcont); $ I ++) {$ tmp $ fcont [$ I]; $ tmpereg_replace (br, $ tmp); if (! Strstr (strto this improvement mainly adds image acquisition and provides a complete function for obtaining remote files. The code is as follows:
$ Fcont = file ("http://www.bjmb.gov.cn/today.asp ");
$ Arr = array ();
For ($ I = 0; $ I $ Tmp = $ fcont [$ I];
$ Tmp = ereg_replace ("
"," ", $ Tmp );
If (! Strstr (strtolower ($ tmp), "img ")){
$ Tmp = trim (strip_tags ($ tmp ));
} Else {
$ St = ereg_replace ("> <", "> Replace <", $ tmp );
$ Stt = split ("Shard", $ st );
Foreach ($ stt as $ key => $ value ){
If (strstr ($ value, "img ")){
$ Tmp = $ value;
If (strstr ($ tmp, "bt9.jpg") | strstr ($ tmp, "colline.gif ")){
$ Tmp = "";
} Else {
$ Tmp = ereg_replace ("\" "," ", $ tmp );
$ St = split ("src =", $ tmp );
$ St1 = split ("", $ st [1]); getpic ("http://www.bjmb.gov.cn/?st1=0]", "image ");
If (count ($ st)> 2 ){
$ St2 = split ("", $ st [2]); getpic ("http://www.bjmb.gov.cn/?st1=0]", "image ");
}
$ Tmp = ereg_replace ("src =", "width = 30 height = 30 align = absmiddle src =", $ tmp );
}
}
}
}
If (trim ($ tmp )! = "" & Trim ($ tmp )! = "") $ Arr [] = $ tmp;
}
$ Yb = array ();
For ($ I = 2; $ I $ Yb [] = $ arr [$ I];
}
?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.