WordPress.org

Ready to get started?Download WordPress

Forums

Request to mod GetWeather plugin (10 posts)

  1. martinez
    Member
    Posted 7 years ago #

    I use this nifty plugin to show the local weather and time on my travel blog. The local time however is being submitted in "4:34 PM" format whereas I would like it to be displayed in 24h "16:34" format, which would require a little clever string replacement coding, I guess. The original developer at http://jrm.cc/ has no contact information, so I can't really bug the original author. Can't say I'm up for the challenge myself, but I was hoping someone else had the skills..

    Example XML from weather.com..
    http://xoap.weather.com/weather/local/CHXX0116?cc=*&dayf=1&unit=m

    ..being parsed by getweather.php:
    http://dev.wp-plugins.org/file/getweather/trunk/getweather.php?rev=529&format=txt

    Help would be greatly apprecieted since most of my friends in Europe get confused over the whole AM/PM thing (btw, what does it stand for?)

    Cheers, Martin

  2. jwurster
    Member
    Posted 7 years ago #

    Looks like no one responded to you. First of all AM means any time between 12:01 midnight and 12:00 noon. PM is the rest of the time. Do you still need help? I was getting ready to look at modifying the plugin to display the temperature in both F and C.

  3. seanrox
    Member
    Posted 7 years ago #

    Try this plugin out:

    http://www.viper007bond.com/wordpress-plugins/weathericon/

    works really nice and does everything you want. I recommend using the beta 3 version. It works really nice.

  4. ladydelaluna
    Member
    Posted 7 years ago #

    i agree with seanrox - however use caution - that plugin makes your site not valid HTML - some people are concerned about that

  5. maerk
    Member
    Posted 7 years ago #

    AM = Ante Meridiem
    PM = Post Meridiem

    Ante means before (as in words like ante-natal or anterior), post means after. Meridiem means midday!

    http://en.wikipedia.org/wiki/12-hour_clock

  6. jwurster
    Member
    Posted 7 years ago #

    I've modified the GetWeather plugin to display 24-hour time by setting a new variable. And I also added the display of temperatures in both F and C degrees. If anyone is interested, please let me know.

    WeatherIcon looks really good, but seemed to be overkill for my needs.

  7. seanrox
    Member
    Posted 7 years ago #

    ladydelaluna: with a couple of small changes to source files, I was able to get it to validate 100%. I've sent the code to the plugin creator so maybe it will get added into the final release.

  8. however use caution - that plugin makes your site not valid HTML - some people are concerned about that

    Huh? My site has always been valid XHTML and I've been using WeatherIcon it for like... ever. ;)

    I think the problem is just the configuration you're using (i.e. you can't have it output in <li>'s if you don't wrap it in some <ul>'s).

  9. ladydelaluna
    Member
    Posted 7 years ago #

    I put the code on it just like you had it in the readme or wherever, VB... I took it out because it instantly made my site invalid... :(

  10. Well I'm sorry, but then you obviously didn't 'cause this should make valid code (copied from the v2.x readme):

    <ul>
    <?php WeatherIcon('station=KLFK&before=<li>&after=</li>'); ?>
    </ul>

    I take making valid code very seriously:

    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.viper007bond.com%2Fwordpress-plugins%2F

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic