- craigh responded to »TagIt 3.0 for Zikula« 01:46 PM
- jmvaughn responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 12:05 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
WeatherCenter Module Fix
Go to page 1 - 2 - 3 - 4 - 5 [+1]:
-
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 110
I think I finally figured out why the WeatherCenter module keeps breaking with blank images and no data. Unfortunately, I am not a programmer....just a network guy. It seems that the module breaks when the fputs($fa,"GET http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=$accid... in the userapi.php returns a blank value (common in Baro ie. Pressure). I have tested this extensively and I know this is the cause. I have switched my city numerous times and the only ones that worked and showed up in the nuke_wthr_cache table are the ones without null values. The ones that didn't work only had the accid and time in the cache table. This has to be the problem. Unfortunately, I do not have the knowledge to re-code this but I would be very appreciative if someone could fix this. I have trying to fix this for months....seems like an awesome module to throw to the waste side. Please PM me if you are able to fix this based on my proposed solution. -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Jun 26, 2009
- Posts: 201
I found the ploplem!the msnbc change the result words as below:
function makeWeatherObj() { this.swCity = "Jinan"; this.swSubDiv = ""; this.swCountry = "China"; this.swRegion = "Asia"; this.swTemp = "61"; this.swTempCel = Math.round((5/9)*(this.swTemp-32)); this.swCIcon = "26"; this.swWindS = "4"; this.swWindD = "N"; this.swBaro = ""; this.swHumid = "52"; this.swReal = "61"; this.swUV = "1"; this.swVis = "999.00"; this.swLastUp = "10/01/2003 22:00:00"; this.swConText = "Cloudy"; this.swFore = "4|5|6|7|1|10/01/2003|10/02/2003|10/03/2003|10/04/2003|10/05/2003|28|30|30|30|30|3|4|4|4|4|61|65|67|68|70|10|0|0|0|0|29|29|29|29|29|4|4|4|4|4|53|54|51|55|56|"; this.swAcid = "CHXX0064"; } -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Jun 26, 2009
- Posts: 201
OK!Done!Go mysite take a look.the new code is below:(just instead from line 659 to 700)
$v_City = "";
$v_SubDiv = "";
$v_Country = "";
$v_Region = "";
$v_Temp = "";
$v_TempCel = "";
$v_CIcon = "";
$v_WindS = "";
$v_WindD = "";
$v_Baro = "";
$v_Humid = "";
$v_Real = "";
$v_UV = "";
$v_Vis = "";
$v_LastUp = "";
$v_ConText = "";
$v_Fore = "";
$v_Acid = "";
while (!feof($fa)) {
$grabline = fgets($fa, 4096);
$grabline= trim($grabline) . "\n";
if (substr($grabline,7,4) == "City") { $v_City = substr($grabline,15,20); }
if (substr($grabline,7,6) == "SubDiv") { $v_SubDiv = substr($grabline,17,20); }
if (substr($grabline,7,7) == "Country") { $v_Country = substr($grabline,18,20); }
if (substr($grabline,7,6) == "Region") { $v_Region = substr($grabline,17,20); }
if (substr($grabline,7,5) == "Temp ") { $v_Temp = substr($grabline,15,5); }
if (substr($grabline,7,7) == "TempCel") { $v_TempCel = substr($grabline,18,60); }
if (substr($grabline,7,5) == "CIcon") { $v_CIcon = substr($grabline,16,20); }
if (substr($grabline,7,5) == "WindS") { $v_WindS = substr($grabline,16,20); }
if (substr($grabline,7,5) == "WindD") { $v_WindD = substr($grabline,16,20); }
if (substr($grabline,7,4) == "Baro") { $v_Baro = substr($grabline,15,20); }
if (substr($grabline,7,5) == "Humid") { $v_Humid = substr($grabline,16,20); }
if (substr($grabline,7,4) == "Real") { $v_Real = substr($grabline,15,20); }
if (substr($grabline,7,2) == "UV") { $v_UV = substr($grabline,13,20); }
if (substr($grabline,7,3) == "Vis") { $v_Vis = substr($grabline,14,20); }
if (substr($grabline,7,6) == "LastUp") { $v_LastUp = substr($grabline,17,20); }
if (substr($grabline,7,7) == "ConText") { $v_ConText = substr($grabline,18,40); }
if (substr($grabline,7,4) == "Fore") { $v_Fore = substr($grabline,15,200); }
if (substr($grabline,7,4) == "Acid") { $v_Acid = substr($grabline,15,20); }
} -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 110
MSNBC changing the result words is not the problem. First, the module works some of the time and some of the time, NOT. If this was the problem, the module would never work. Secondly, I thought the same thing, so I dug through all of the code and changed the variable to match MSN's results...still same results...fixs have of the time. I'm telling you, the problem is when the results of the GET from MSNBC has blank values in it....usually Baro|Pressure. See my original post why. Also, I went to dozens of sites that had data and dozens that were broken. The sites that worked had a value for Baro|Pressure....the sites that were broken didn't have any data for Baro|Presure. The problem is that the WC code doesn't know what to do if MSNBS returns empty values. I tried changing the values in the cahe table to allow blank data but still didn't fix it. Someone with extensive PHP scripting ability needs to go through the code and fix it so the module knows what to do with empty fields from MSNBC. This is a awesome module and I really hate to see it go to the waste side.
BTW, does anyone know where I can find WeatherCenter 1.28. I seen it a few months ago and cannot find it now. There is also a version out there that shows a radar window in the 'Detailed Forecast'...which version is this? I saw it on a Mexican site and cannot find it now. -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 110
ccm111. This didn't work for me. Probably because there are many other places throughout the code that uses the variables from MSNBC. If you add 2 more fields from MSNBC to the results, you got to make the neccesary changes in the rest of the code. Also need to make the appropriate changes in the nuke_wthr_cache table. It may be working for you because MSNBC is returning a value in the Baro variable. What is your accid or location? -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 110
I am running the new accids. Please, try using these two accids in your module: USOH0557 and USOH0212. My town, USOH0557 comes up empty data missing images because the Baro variable from MSNBC is empty. Now, USOH0212 works because the Baro field has data.
Also try these:
http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=USOH0557 --- returns empty Baro variable
http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=OSOH0212. --- has data in the Baro variable.
Let me know
Go to page 1 - 2 - 3 - 4 - 5 [+1]:
- Moderated by:
- Support
