ArticleSource: http:/bloglog.csdn.net/foxmail.
Add the following statement to "options"> "configuration"'s "static news/Declaration:
If you want to specify a city, you should change the src attribute value of the IFRAME label to http://appnews.qq.com/cgi-bin/news_qq_search? City = XX, but it does not seem to work here, so I used the URL forwarding, that is, using weather.lovesnow.com to turn to the http://appnews.qq.com/cgi-bin/news_qq_search? City = Shanghai.
So the added content shoul
Under Linux to execute the following code will have this effect out, do you want to try Ah?
The code is as follows
Copy Code
#coding: Utf-8 Import Urllib2 Import JSON # 101230201 Xiamen code number url = ' http://m.weather.com.cn/data/101230201.html ' re = Urllib2.urlopen (URL). Read () Re = Re.decode (' UTF-8 ') We = json.loads (re) [' Weatherinfo '] Print u ' cities: ' + we[' city '] Print u ' Date: ' + we[' date_y '
(up to 5 days), for example, to view the weather forecast for 5 days:
$ wego 5
To check the weather in another place, you only need to provide the city name:
$ wego Seattle
Problem Solving
The following error may occur:
user:Currentnot implemented on linux/amd64
This error occurs when you run wego in a
Get weather from Linux-shell and from linux-shell
Using the shell in Linux to get the weather is difficult. It turns out that it is really simple and the single-digit code will be done.Obtain the weather of the target City
All
Linux-shell get weather
Using the shell in Linux to get the weather is difficult. It turns out that it is really simple and the single-digit code will be done.
1. obtain the corresponding city weather
All weather information is
Using the Linux shell to get the weather, it would be difficult, originally, really simple, single-digit code is done.Get weather for the corresponding cityAll weather information is obtained from the China Weather Network. Each city will correspond to an ID (for example, Be
window| Program | weather Forecast | This improvement is mainly to increase the image acquisition, and provide a relatively complete function to get the remote file. The specific 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 ("if (!strstr (Strtolower ($tmp), "img")) {
$tmp =trim (Strip_tags ($tmp));
} else {
$st
The improved auto-show weather report applet (available in both Linux and Windows environments)-PHP application-PHP Tutorial -. 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. as this improvement mainly adds image acquisition and provides a complete function for obtaining remote files. T
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.