Viewing 15 replies - 46 through 60 (of 207 total)
  • David – actually, I had been thinking about taking one step further and storing the config data in a table within WP. But I think I’ll hold off on that until the new wp-plugins structure becomes available. I’ve also thought about adding a field where users can set their local station, then they would get their weather.
    TG

    Yeah, that would work.
    Unfortunately, I just found out that the weather check was contributing up to 3-5s delay in my pageloads. Since I’m trying to build a semi-‘professional’ site, I’m attempting to keep pageloads around or under 1s, basically…. so away the weather goes. I’ll stick it off on its own page or something.
    (oh, and it’s not just weather… some of my article-regex scanning code was adding an extra second or two, and unfortunately I really NEED that code in as it shows pretty custom graphics for articles… so that’s where my time goes next. JOY.)
    -d
    https://www.chait.net

    Mabe it’s time to start caching parts of the site……
    TG

    I’ve been looking into caching systems… trapping the output and writing to a file, etc. But as I continue to make the site MORE dynamic, the two purposes are at odds.
    I just can’t afford a given module that introduces multiple seconds of delays. If I was running my own server, I could run some stuff in the background, update every hour or something into a file or the db… but in my current shared hosting I can’t really do that (aside from on-the-fly cache/update stuff, which means >someone< takes the hit once per hour or so… ?? ).
    As I said, this might be a good thing for some kind of separate page, much like I’ve seen people do for RSS feeds that take too long or take too much space.
    As I’m back down under 1s with all my optimizations last night, I’m happy with where things are at. Definitely worth having the weather module do some caching internally — could just mimic what I do with feeds/amazon stuff (just with a more rapid expiration time).
    -d
    https://www.chait.net

    >>davidchait: i can remember you that the weather reports are created each 4 hours on most servers, so if your site is occupied, it’s a good way to minimise calls by caching the weather report per 3 or 4 hours…
    i have a complete weather system on my own, and it’s caching weather per cities, and i only ask the script to check if the cache-file is older than 4 hours ago… if yes, i pick up a new report.. else, i use the cached one… the results are cached as a final array, so i don’t have to filter the cached result after the first read…

    Weather reports are created each hour, unless the weather changes dramatically.
    phpWeather uses caching and database tables. Which basically the same as this hack.

    Hi,
    I had the hack working nicely, but it broke with a local time of 3:01 am and a condition of light rain. I mean, the weather text was diplayed, but the icon didn’t show up, just the question mark meaning the image wasn’t found. Upon checking the source for the page, i noticed the img src called for the correct directory, but the icon requested was just “n_”, which makes me suspect there is a problem in the code, because it means no condition was specified.
    I then unziped the hack zip file again, and installed it fresh (to check if i didn’t mess it up myself when localizing), but the icon still didn’t show.
    Could someone check that, please?
    Thanks, Eduardo

    Just noticed one more thing, as i started to read the code generated by the weather hack for the index.php page: sometimes the icon and the condition will not match. For example, i just got and icon called 4cloud_modrain.png (which seems to be moderate rain) and the text condition displayed was ‘light rain’.
    And if one takes a look at the language.php file, one sees that there is no placeholder for ‘moderate’, nothing like _MOD or _MODERATE.
    Maybe the code can be improved to acount for that?

    here my test mod
    just a test i will package and arrange this week end
    (it s seems my weather use gif now :/ and some icon dont use)
    https://focana.free.fr/wordpress/weather/

    I can’t see the code, unless you rename the files *.phps . Well, i can’t code anything either, then it’s no big deal i can’t see it…
    I am looking forward for you mod, please post when you finish it!
    Eduardo

    I was changing the code of the places that i want the weather to be shown, from WSSS (Singapore) to RCTP (Taiwan), and then i saved the file and true enough the weather started showing about Taiwan’s Weather. Then, in the space of 5 mins, i decided that i wanted to do a focus on Euro 2004 and thus wanted the weather outlook of Portugal. So i changed from RCTP to LPPT (Portugal) and saved.
    When i refreshed my test site, i saw that 5 warning messages about headers already been sent.
    What can be done to eliminate this problem since i would like to allow my users to choose the weather they would like to see?

    As i was saying:
    I was changing the code of the places that i want the weather to be shown, from WSSS (Singapore) to RCTP (Taiwan), and then i saved the file and true enough the weather started showing about Taiwan’s Weather. Then, in the space of 5 mins, i decided that i wanted to do a focus on Euro 2004 and thus wanted the weather outlook of Portugal. So i changed from RCTP to LPPT (Portugal) and saved.
    When i refreshed my test site, i saw that 5 warning messages about headers already been sent.
    What can be done to eliminate this problem since i would like to allow my users to choose the weather they would like to see?

    The only warning I see is associated with your random quote plugin.

    sorry, it was at my test site
    but i reloaded my files to eradicatee this problem.
    But i tried changing it twice already and its always the same.
    First change ok. Second change warning messages.

    Why not make it a real plugin instead of using the hack file?

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