Viewing 15 replies - 106 through 120 (of 207 total)
  • I see my name being bandied about… ??
    There’s the connection between your server and the NWS server, and there’s the connection between your own PC and your server. If the latter is slower than the former, and the former quite speedy, you’ll likely see no bennies from caching. My code is set up to make the cache-time variable; if you set ‘$shelfdate’ to zero, there’s no checks made against the old stored data. This may be something you want to pursue, or not.
    I’m displaying reports from about 17 different stations on two sites now, so I see benefits in caching. As far as I can see, it takes longer to load and display links (and a bunch of older posts with fat pictures) than it does the weather. But that could well be a function of where I’m sitting in relation to my host.

    Have you looked into a way to disregard the $shelfdate if the metar data is incomplete, bad or nonexistent (“Weather data not available”)? I am trying to figure out just how to do that.

    Thread Starter jeremiah

    (@jeremiah)

    I just discovered that some called “slurdge” sent me a caching function. I’ve added it to the zip file until I get something better.
    https://www.sonicpling.net/weather/weather-plugin.zip
    it caches to a file in the plugins folder named “weather.txt”
    –Jeremiah

    Thread Starter jeremiah

    (@jeremiah)

    doh!
    I keep forgetting to take multiple stations into account.
    –Jeremiah

    Thread Starter jeremiah

    (@jeremiah)

    Thanks To Pericat for pointing out a flaw in the conversion from meters to miles for the visibility. Fixed that.
    I’ve also changed the script to use gmdate so that the time offset works correctly. and added a debug so that you can see what it thinks the hour actually is.
    I’ve also started actually using the version number!
    so, version 1.1 is now available… same location:
    https://www.sonicpling.net/weather/weather-plugin.zip
    –Jeremiah

    Ha, I forgot to look into that when one day the visibility was over 1o miles and I just knew that couldn’t be right. Let’s hope as more people use this we can fix more errors. There are times when the metar is not parsed correctly and I get “data not available” messages but I have not had the time to look into where it “breaks”.

    Getting whacked results is often rewarding in itself. I still remember seeing “blowing grains of snow” with a temp of 37F…
    Most of the straight conversion formulas have been passed around for years; it’s easy for typos to creep in. After I found one in PHP Weather (from where I culled the formulations I use), I started checking them all against those listed on several different websites. It was a bit of a pain, to put it mildly. ??

    Very nice work on this hack, I got it up and working in less than 15 minutes. One question, do you know how it decides between night and day for the images? It stays light out until 9ish here now, but at 6 the image starts showing the night pics. Thanks, btw, you can see how I have it displayed at https://dudeweek.blogdns.com

    Thread Starter jeremiah

    (@jeremiah)

    Look for these lines:
    // if night, icon is different
    if((intval($now)>='18' && intval($now)<='24' || intval($now)>= '0' && intval($now)<='6') && !$no_night) $wxInfo['ICON']= "n_".$wxInfo['ICON'];

    It works in military time (24 hours)..
    It says basically:
    If the time is between 18 and 24 (hours) or if the time is between 0 and 6 (hours) then use the night icon.
    If you want to see the moon at 9pm then simply change the ’18’ to: ’21’
    –Jeremiah

    Thread Starter jeremiah

    (@jeremiah)

    I should probably make that an option.
    does anyone else think that they’d like to see an option to set the sunset and sunrise times?
    –Jeremiah

    Just since I know Beel’s been throwing my name around… (I thought my ears were burning!)
    Caching of even the simplest lookup results from an internet service makes a HUGE difference. Definitely cache to a file unless you have complex interactions where you’d need the power of a database… otherwise, you take a hit going across to the SQL server to retrieve your data — which just isn’t worth it.
    CG-Amazon only just yesterday gained a NOCACHE option, for specific administrative displays only. For all site-wide displays, the caching is done on a query or asin basis, to individual files. This also means that when Amazon goes down (nahhh, that never happens… ?? ), there’s still some ‘recent’ data around that you can display using…
    Just thought I’d chip in some thoughts quickly. Haven’t had time to look at the code… Still in convert CG-to-plugins mode (have been for nearly 10 days now!).
    -d

    Thread Starter jeremiah

    (@jeremiah)

    Beel,
    Just for you! ;-P
    https://www.sonicpling.net/weather/weather.phps
    –Jeremiah

    Does anyone know why the icon appears with a black background when I’m using the default icons?

    Thread Starter jeremiah

    (@jeremiah)

    Internet explorer chokes on transparent png’s.
    You can either use this workaround that star found:
    https://homepage.ntlworld.com/bobosola/
    Or use the alternate images included in the zip file.
    –Jeremiah

    This is the what I use to transform my png’s for IE:
    https://www.koivi.com/ie-png-transparency/

Viewing 15 replies - 106 through 120 (of 207 total)
  • The topic ‘Weather Hack’ is closed to new replies.