From: Jung m. s. <ren...@us...> - 2004-07-30 00:08:35
|
rena1120 04/07/29 17:08:29 Modified: KmaWeather kmaweather.py Log: Fixed. Revision Changes Path 1.4 +3 -3 plugins/KmaWeather/kmaweather.py Index: kmaweather.py =================================================================== RCS file: /cvsroot/sugarcube/plugins/KmaWeather/kmaweather.py,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- kmaweather.py 3 Sep 2003 02:14:32 -0000 1.3 +++ kmaweather.py 30 Jul 2004 00:08:28 -0000 1.4 @@ -8,7 +8,7 @@ import urllib, re, math -findweather = r'\<td bgcolor=\#DBF3FF class=text\>%s\</td\>[^\n]*\n' +findweather = r'\<td bgcolor="#D0E6BF" class="text"\>%s\</td\>[^\n]*\n' untag = re.compile(r'(\<[^>]*\>)') #---8<--- cut to other module --- @@ -76,7 +76,7 @@ class KMAWeather: - KMAURL = "http://www.kma.go.kr/kma_syn/sfc_now.html" + KMAURL = "http://www.kma.go.kr/weather/current/sfc_now.jsp" dataindex = [ ('region', 0), ('weather', 0), ('seelevel', 1), ('cloud', 1), ('temperature', 1), ('winddir', 0), ('windvelo', 1), ('humidity', 1), ('rainfall', 1), ('discomfort', 1), ('baro', 1) ] @@ -103,7 +103,7 @@ self.update() def update(self): - self.wdoc = urllib.urlopen(self.KMAURL).read() + self.wdoc = urllib.urlopen(self.KMAURL).read().replace('\t', '').replace('\r', '').replace('\n', '').replace('/tr>', '/tr>\n') def getweather(self, region): m = re.findall(findweather % region, self.wdoc)[0] |