Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  Extensions and Distributions Support ::  Modules ::  WeatherCenter Module Fix

Moderated by: Support Team

Goto page : 1 | 2 | 3 | 4 | 5 Next Page
Bottom
WeatherCenter Module Fix

  • Link to this postingPosted: 01.10.2003, 18:06
    Profile Homepage
    brammerv
    rank:
    Helper Helper
    registered:
     June 2003
    Status:
    offline
    last visit:
    01.02.06
    Posts:
    111
    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/ch...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.
  • Link to this postingPosted: 02.10.2003, 09:16
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    I think maybe the ploplem is on msnbc.Sometimes it can fecth data from msnbc,but not always.so,I set cachetime to 50000,at least,it seems to work.

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 10:33
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    The path to msnbc database is correct(you can try it just in browse window,and everything is ok).Then I think the ploplem is easy to solve.I'll try .

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 11:16
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    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"; }

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 16:50
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    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); }
    }

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 16:53
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    http://www.top100cn.com
    or 61.145.112.100
    you can try it!It's very well!

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 16:55
    Profile Homepage
    brammerv
    rank:
    Helper Helper
    registered:
     June 2003
    Status:
    offline
    last visit:
    01.02.06
    Posts:
    111
    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.
  • Link to this postingPosted: 02.10.2003, 17:09
    Profile Homepage
    brammerv
    rank:
    Helper Helper
    registered:
     June 2003
    Status:
    offline
    last visit:
    01.02.06
    Posts:
    111
    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?
  • Link to this postingPosted: 02.10.2003, 17:21
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    I'm from china.the accid of msnbc is now eight number.you can go to msnbc and check your local accid.I's a very easy thing.then, change your accid data file.that's ok.

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 17:22
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    something like CHXX0028

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 17:24
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    you should have weather 1.28

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 17:27
    Profile Homepage
    brammerv
    rank:
    Helper Helper
    registered:
     June 2003
    Status:
    offline
    last visit:
    01.02.06
    Posts:
    111
    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/ch..._src.asp?acid=USOH0557 --- returns empty Baro variable

    http://www.msnbc.com/m/ch...src.asp?acid=OSOH0212. --- has data in the Baro variable.

    Let me know
  • Link to this postingPosted: 02.10.2003, 17:28
    Profile Homepage
    brammerv
    rank:
    Helper Helper
    registered:
     June 2003
    Status:
    offline
    last visit:
    01.02.06
    Posts:
    111
    Can't find WeatherCenter 1.28. Do you know where I can get it?
  • Link to this postingPosted: 02.10.2003, 17:31
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    I can give you!wait a moment,you can download from mysite.first line the third button.

    -----
    modules&blocks downloads
  • Link to this postingPosted: 02.10.2003, 17:41
    Profile Homepage
    ccm111
    rank:
    Helper Helper
    registered:
     September 2003
    Status:
    offline
    last visit:
    03.01.05
    Posts:
    202
    OK!I have improved for you.

    -----
    modules&blocks downloads
Goto page : 1 | 2 | 3 | 4 | 5 Next Page

Start ::  Extensions and Distributions Support ::  Modules ::  WeatherCenter Module Fix

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to Zikula