Thatgeek – Previously Sonicpling

Saturday March 12, 2005

WeatherIcon 2.0

Filed under: General — Jeremiah @ 11:09 pm

Update Friday July 20th:
For those of you looking for the download, check here:
WeatherIcon Download

Exciting news for WeatherIcon (a plugin for wordpress that shows the current weather conditions for your location with a pretty icon)

Thanks again to Garett for his hard work we are now at version 2!

This release adds these features (I’m sure I’ve forgotten some):

  1. an options page in wordpress 1.5
  2. better localization support
  3. automatically linking to the cache (if you place it in the recommend location)
  4. automatically linking to the icons (if you place them in the recommended locations)
  5. several contributed bug fixes (including one from Bob Crispen Thanks Bob!)

This release will only work with wordpress 1.5 so I’m going to leave the older version up for those who still need it.

Get it here: http://www.viper007bond.com/wordpress-plugins/weathericon/

If you’re interested in creating localizations for WeatherIcon please contact me.

Here’s some additional info from Garett:
It should be noted that the language files in the languages directory were intended as a sample. While French (francais) is the same as the French language php file that was available for download before (and should thus work the same as before), it doesn’t have the localization for the configuration page and the German (Deutsch) language file only localizes the configuration page and I’m not overly confident in the translation thereof (I’m not a native German speaker with a limited vocabulary).

In any case, it might make more sense to download language files separately, should they be need. The script should work fine without the additional language files (unless I really screwed up the configuration page). Also while both the po and mo files should be offered for download, it should be noted that the po files are only needed if changes/fixes/additions need to be made to the translation. PO’s by themselves are useless to wordpress (and thus this plugin) and have to be compiled into a mo file before they can be used (msgfmt -o language.mo language.po in unix or using poedit). More information on localization is available on the wordpress wiki.

Update: New version is available (2.0.1) - (it’s in the same location)
Changes are:
- Fixed Missing Descriptor for visibility.
- Removed border attribute from image
- Fixed fread error on initial creation of cache file.

240 Responses to “WeatherIcon 2.0”

  1. Joey Says:

    Looks nice, I’ll probally end up using it. :)

  2. Les Bessant Says:

    Thanks - installed and working.

  3. Prz. Says:

    The plug is very nice, but please, tell me how can I change mph to km/h, miles to km, °F to °C etc.? I was trying change it in the part “$weather_default_settings = array (…)” in WeatherIcon.php but it doesn’t work.

    And the second question: where is the part of script where I can disable Dew Point, Visibillity, Clouds etc.?

    Sorry for this lamer question, but I’m not good in php.

  4. Prz. Says:

    I’m blind. ;) I can’t see that options are in WP menu. Sorry for disturb.

  5. Vkaryl Says:

    Jeremiah, I can’t get your link to start a download - it just takes me to a 404 not found error page….

  6. Vkaryl Says:

    Thanks for emailing it to me…. I just now realized what the problem is: I have referrer logging off by default; usually I remember to set it on when I’m going to download something - or go to my bank, but I haven’t been feeling very well, so spaced it this morning. Sorry!

  7. pau Says:

    CAn’t see the options page neither!

  8. Jeremiah Says:

    The options page is under “options” not “plugins”.

    if you click on options you should see a new one listed beside:
    General : Writing : Reading : etc.
    it will be labeled “WeatherIcon”

    –Jeremiah

  9. Zulan Says:

    Great plugin! Thanks!

  10. Aaron Says:

    Great plugin, thanks! FYI for anyone else, if you don’t know your weather station codes you can look them up here:
    http://weather.gov/tg/siteloc.shtml

  11. Zulan Says:

    I noticed that my icon never changed. So I tested with changing to alternative icons under the options meny, now I dont get an icon at all. Not even if I change it back. Also, every time I update the options I get another / in my chache dir. Really strange, so after updateing twice it looks like this C:\Program Files\Apache Group\Apache2\htdocs/wp-content/plugins/WeatherIcon/cache.

    Any idea?

  12. arex Says:

    that was awesome. so much easier to configure. i was actually doing it the original (difficult way). thanks for the Options feature! =)

  13. Linda Says:

    I really like this plugin and had no problems with it in my WP 1.2 blog. Now I installed a new 1.5 and I just don’t find out where to switch to german language. I downloaded the “deutsch.mo and po” files. In the weathericon.php I added “$weather_settings[’language’] . ‘deutsch.mo’);”, but this doesn’t seem to be correct, as nothing changed. Any hints?

  14. Fletcher Says:

    Can someone tell me how to add international cities?

  15. Eric Says:

    Thanks for the great plugin! FYI, a small typo … Line 800 reads: (’ENE,_EtherIcon’) should be: (’ENE’, ‘WeatherIcon’)

  16. Sonicist » This is good. Says:

    aude all these guys (and gals) who do this out of love for their work. For Wordpress 1.5 this is a fast to install and well put together thing to try to add. Earier versi […]

  17. Robert Says:

    Wind direction bug

    Problem regarding wind direction. (’ENE,_WeatherIcon’)
    Text is being displayed when ENE is called up.
    Bug Fix should be (’ENE’, ‘WeatherIcon’)

  18. Andy Says:

    The plugin works great but I’m in France and I get this rather than the appropriate symbols. Blank spaces would be better.
    # Temp: 11?C
    # Humidity: 94%
    # Wind: W at 6 km/h
    # Dew Point: 10?C
    # Barometer: 29.77″ Hg (1008 hPa)
    # Clouds: mostly cloudy
    # Visibility: 10 km
    Also, I don’t get the same images in Firefox or IE. Stange.

  19. Hi! I’m clsung » Blog Archive » [WP] WeatherIcon2 Says:

    分類 10縣市 周五起開罰

    [WP] WeatherIcon2

    改用 WeatherIcon2 一陣子看看。GetWeather 好像各有千秋,所以還是先保 […]

  20. Garett Says:

    Linda: Languages are best controlled through the settings page under options. While one could hard code it with a $weather_settings[’language’] = “deutsch”; in the right area in the code, but I don’t recommend doing that since it completely overrides the configuration page. In addition, the German translation is merely an example, and I’m not sure overly functional (unless someone has fixed that).

  21. Rocky Says:

    Jeremiah,

    Which file should I change to display the weather information. Currently is display

    San Francsico,
    * scattered clouds
    * Temp: 52°F
    * Wind: NW at 16 mph
    * Clouds: scattered clouds
    * Visibility: 10 miles

    I like it to display in a single line like this.

    Current weather in San Francsico * scattered clouds * Temp: 52°F * Wind: NW at 16 mph

    Can you show which file I should change, I am not very php literate so please help me.

    Thanks in advance.

    Rocky

  22. Agsedu » Sonicpling - Jeremiah’s Blog » WeatherIcon 2.0 Says:

    […] therIcon 2.0
    Published on 29 Mar 2005 at 9:37 pm.
    No Comments.

    Filed under Main.
    Sonicpling - Jeremiah’s Blog » WeatherIcon 2.0 If you don�t want to download […]

  23. Logan Says:

    Jeremiah: excellent and brilliant plugin! Really spruced up my site. By the way, it took me awhile to figure out that the “removing bullets” issue that some people have is related this statement in the default Kubrick theme that ships with Wordpress 1.5:


    /* BEGIN ENTRIES */

    .entry ul li:before, #sidebar ul ul li:before {
    content: "0BB 020";
    }

    If you remove

    #sidebar ul ul li:before

    from the statement it will remove all of your bullets. Cheers!

  24. Logan Says:

    Well, the escaped characters didn’t render quite properly, but I think it’s enough info to help other people with this problem. Sorry for the double post.

  25. A M Shaffer Says:

    Jeremiah,

    I too have problems with my weather icon never seems to change. Is there something I can do to fix this?

    Thanks for such a great plugin. :)

  26. A M Shaffer Says:

    Never mind… It’s working fine now.

    :D

  27. stinner dot com » Weather Icon 2.0 Says:

    […]

    I have added my local weather to the left sidebar with a WordPress plugin called WeatherIcon 2.0. It’s a neat little plugin. It displays temperature, humidi […]

  28. WordPress Italy » Archivio Blog » Plugin WordPress: WeatherIcon 2.0 Says:

    […] « Tema WordPress: Tulip Plugin WordPress: WeatherIcon 2.0 WeatherIcon 2.0 è un plugin che mostra in forma di icona, le attuali condizioni me […]

  29. Curious George Says:

    How would one display weather for 3 different cities?

    Would I have to copy the wp-content/plugins/WeatherIcon.php script to 3 different names, change the PluginName line in each file to correspond to where I am want, activate them separately in the admin panel and then do somethine like:

    <?php NewName1('City_Code'); ?>
    <?php NewName2('City_Code'); ?>
    <?php NewName3('City_Code'); ?>

    Or is there (hopefully) an easier way?

    Thanks.

  30. Jeremiah Says:

    Curious George:

    all you have to do is call the function again:


    <?php WeatherIcon('City_Code'); ?>
    <?php WeatherIcon('City_Code2'); ?>
    <?php WeatherIcon('City_Code3'); ?>

    –Jeremiah

  31. Remote Control » WeatherIcon Added to Site Says:

    […] tions given. Other than that, installation was a snap. WeatherIcon can be downloaded at:

    No comments have been added to this p […]

  32. Z Says:

    What does this mean? “chmod the “cache” folder inside the “WeatherIcon” folder to “777″”

  33. inforedesign » Blog Archive » WeatherIcon 2.0 Says:

    […]
    « Understanding Blog Speak

    WeatherIcon 2.0

    WeatherIcon 2.0 — погодный плагин для WP (пример вн […]

  34. CeprixConception » Playing around with WP Plug-ins Says:

    […] thing new, which says Weather, is up in the sidebar. This is powered by the plug-in called WeatherIcon by Jeremiah. WeatherIcon shows weather information of the location you […]

  35. Frost Says:

    Z, I had troubles with that too, since I am new to this stuff. chmod the cache folder doesnt mean rename it. chmod means to set the permissions on the folder to read and write for everyone, or the code 777. Easiest way is to do it from your c-panel from your website..file manager kind of thing..find the folder there, click on it and find where it says change permission and change it to 777.

  36. The Boschmans Account » Blog Archive » WP Plugins to investigate : Says:

    […] stly this is a note to myself). One-Click Backup of WP Database Optimize your database Have a icon showing the local weather. Here’s another note to myself : remin […]

  37. Noel Says:

    Thanks for a great plugin!

    I was wondering why the wind direction no longer shows up in my report.

    I’m comparing Get Weather and Weather Icon on my page - weather icon is at the bottom of the sidebar http://www.juicygeography.co.uk/blog

  38. Noel Says:

    add to the above post that wind direction works intermitently

  39. Kemitix.net » Blog Archive » Today’s del.icio.us bookmarks Says:

    […] s, and skills into categories that suit your campaign." Tagged as: online rpg tools Sonicpling - Jere […]

  40. Universe » Archives » More notes to self… Says:

    […] to do Version Control for my theme (especially since I don’t have a shell) - install WeatherIcon 2.0 - optimize my databases And now I’m off to pick up my comput […]

  41. Kemitix.net » Blog Archive » First Service Says:

    […] 17;s definitely on the chilly side today. Now I even know how cold it is having added the WeatherIcon plug-in to my site. Bumped into my cousin Elaine and her husband while […]

  42. Mike Says:

    Hey, is there any way for the weather icon to show in IE? It works fine in Firefox, but nothing comes up in IE other than the text.

  43. mewebdev » How’s the weather? Says:

    […]
    How’s the weather?
    I’ve found a great weather plugin for Wordpress called WeatherIcon 2.0 by Jeremiah. You can see it in operation on the right hand side on […]

  44. iRock » New layout Says:

    […] theme is titled Falling Dreams 1.0 and made by Razvan Teodorescu. I’ve also added an Weather Icon on the right hand side of this blog. So, if you are interested in to se […]

  45. Ken H Says:

    I am unable to download new weather data — cache directory and CHMOD are correct, weather debug option results is this, any thoughts? Station is KNBC, KLFK gave same error …

    Cache Debug
    o Cache Timeout: 1200
    o Cache File Age: 0 (note: this resets to 0 upon page refresh, timeout is 1200)
    o Fetching New Metar Data
    * Weather data not available

  46. Ennis Says:

    im having troubles with this plugin. Although its great, the pngs won’t show up. All the locations are correct. All i get is white area above the text

    also, i get the “no weather data available” message more then i would like.

    any solutions to these problems

  47. prerona Says:

    I have the same problem.

  48. Marchal Says:

    I installed the plugin today with WordPress 1.5 and like it a lot. Thank you!

  49. MooreMeister.net » Blog Archive » Todays Hacks Says:

    […] ave yet to test on this site. CGFeed — http://www.chait.net/index.php?p=85 5 stars WeatherIcon — http://www.sonicpling.net/archives/2005/03/12/weathericon-20/ 5 […]

  50. Adrian Says:

    Hi,

    When I activate the program I get
    Fatal error: Call to undefined function: load_textdomain() in /home/jfsccom/public_html/blog/wp-content/plugins/WeatherIcon.php on line 119
    but I can’t see what is wrong with the line in question as I have not changed it. The line is
    load_textdomain(’WeatherIcon’, ABSPATH . ‘wp-content/plugins/WeatherIcon/languages/’ . $weather_settings[’language’] . ‘.mo’);
    Any help would be appreciated.

    Also will you be setting up a forum for this?

  51. Jeremiah Says:

    Adrian:
    it looks like you’re using Wordpress 1.2.1
    this plugin will only work with wordpress 1.5 and higher, but there is an older (not as nice) version of the plugin still available here

    I would recommend upgrading wordpress, rather than downgrading the weather-plugin though.

    –Jeremiah

  52. Jeremiah Says:

    Ennis:
    looks like you got it working. sorry that it took me so long to reply.

    prerona:
    it looks like the folder you have the icons stored in is protected.
    you need to change the permissions (chmod) on the ‘wicons’ folder to allow anyone to view it. that should make the icons appear.

    –Jeremiah

  53. Un violon à Paris » Archives du blog » Remerciements / Credits Says:

    […] ol Witty Text Plugin. You will always know the weather in Paris thanks to Jeremiah’s Wheather Icon Plugin. My posts are made printer-friendly by Chan Hong Wei’s W […]

  54. DK Says:

    Thanks for your wonderful plug-in! I’ve been messing with customizing it all day and can’t seem to find a way to not have a bullet display just next to the image icon. I’m pretty new to CSS, but I’ve tried just about every combination I can think of and I still get a bullet based on the #sidebar li definition. Is there some sort of trick that I’m missing or is there no way to override just the first li in an ul?

    Thanks for your time!

    Cheers, DK

  55. ChrisBunting.com » Blog Archive » Changes: Round 2 Says:

    […] but for now I’m just having way too much fun with the plugins. I’ve added the WeatherIcon2 plugin to show the local weather and other information […]

  56. Ennis Says:

    Hey, thanks. I did get it working, but i noticed one small problem. With firefox the two images 1cloud_fog.png & 2cloud_fog.png ( i believe its them too) don’t show up, all is there is a white space. Might be something u wanna look at. I know its not just mine, i’ve noticed it on others as well.

  57. Ennis Says:

    btw, is there a way to do a X day forecast, where x equals a number of days (Example: Extended 5 day forecast, where in this case x=5)

  58. dan Says:

    I need some help man.. I just can’t seem to find the right place to insert this weather code and get it nice and pretty like on your site without totally mucking up the xhtml validation. will you go check out my site and tell me if you know what im doing wrong? i’ll give you my login info if you need to look at the actual templates. let me know!

    thanks,
    dan

  59. Ennis Says:

    who you talkin to dan….if you want me to help i can…just lemme know.

  60. Ennis Says:

    nm looks like u got it working.

  61. Jeremiah Says:

    Dan:
    it looks like you just need to add a UL around the code.
    like this:
    <?php if (function_exists('WeatherIcon')) : ?>
    <ul>
    <li class="weather">Lufkin, Texas
    <ul>
    <?php WeatherIcon('KLFK'); ?>
    </ul>
    </li>
    </ul>
    <?php endif; ?>

  62. Jeremiah Says:

    Ennis:

    The national Weather service does make forcast information available for some stations, but the WeatherIcon doens’t look for or parse that information.

    there was a plugin that someone was working on that did pull forcast data, but I can’t locate it now. you might ask in the wordpress forums.
    I think Beel was the one who pointed it out to me.

    Jeremiah

  63. Ennis Says:

    Thanks dude. just askin out of curiosity.

  64. Sibaritico Says:

    Hola.. Tengo un problema con el plugin. La temperatura ni la imagen cambian en ningún momento. Quedan fijos en:

    # Temperatura: 15°C
    # Humedad: 42%
    # Viento: ESE a 6 km/h
    # Nubes: cubierto
    # Visibilidad: 10 km

    con la imagen “4cloud_norain.png”

    No se actualizan! Por favor si alguien me pudiera ayudar estaria agradecido.

    Bye

  65. Joel Says:

    Removing the bullets from each list item is so easy once you know what to do!

    I tried hacking my style sheet as suggested by #23 above but that removes all bullets in the sidebar. I read through the code of WeatherIcon.php and saw that there are three parameters to the WeatherIcon function. The first parameter is the Station code which we are all familiar with. The other two (optional) parameters are the before and after tags to each list item. (They default to opening and closing LI tags.) All you need to do is specify your custum Before and After tags when you make the weather call.

    Here is how I’m making my call from the sidebar,php file:
    <?php if (function_exists(’WeatherIcon’)) : ?>
    <li class=”weather”><h2>The Weather</h2>
    <ul><b>New York, NY</b><br /><?php WeatherIcon(’KLGA’, ”, ‘<br />’); ?></ul>
    </li>
    <?php endif; ?>

    The second parameter (after ‘KLGA’) is blank, which means do not insert the default <LI> tag. The third parameter is a <BR /> tag which replaces the default </LI> tag.

  66. BOK Says:

    Did they change the METAR-code?
    I get “Weather data not available”, but the cache-file is filled with data that makes sense but can’t be parsed:

    EHGG 021125Z 27007KT 230V310 3900 -RA NSC 18/15 Q1010 BECMG 5000 TEMPO -SHRA SCT030CB

  67. DE Says:

    Question about the weather icons updating from day to night. From the Options-Weather Icon menu in WP, you can adjust the sunrise and sunset times. However, is this information (system time) coming from the server or the local client accessing the icon? In other words, if your files are being hosted on a server in another time zone, you get the wrong day/night icons. Is this correct and if so is there a workaround to display your local time? Thank you for any suggestions.

  68. swellt Says:

    Great hack, thanks for posting this. I see above another commenter asked how to post all this info on one line. What if you want to say something like, “In New York it’s currently X degrees and conditions are X.”? How can insert text in between the data and post it as one string?

  69. swellest » Blog To-Do’s Says:

    […] Put default value in search box and clear upon user selection WP: All Options Access Weather Icon Condensed Content *Deactivated QuickTags in Safari […]

  70. Brian Says:

    Three questions… (one which has been asked a few times):

    1) Any way to change the display of the weather? I.E. on my web site (www.brianx.net) It might be cool to have the weather displayed in a horizontal fashion across the top banner instead of on the side bar… either in a graphics format or in a text format…

    2) Any way to change to the order that the output is displayed? For instance, I am using:

    Weather
    Temp: 46°F
    Wind: NNE at 8 mph
    Clouds: overcast

    I’d like to do:
    Weather
    Clouds: overcast
    Temp: 46
    Wind …

    I tried changing it in the array, but that didn’t seem to work?

    And last, but not least… Has anyone created any other weather icons? NOAA/NWS is looking at some new icons.. http://www.weather.gov/icon_comments/

    Maybe we can, um, borrow theirs?

    :-D

    By the way, thanks so much to all the developers and contributors of this wonderful program. :)

    Cheers,
    Brian

  71. James Says:

    Hello, u have a nice site!
    http://webcams.jmkl.com/live/

  72. Anh Tran’s Blog » Blog Archive » Change in Sidebar Says:

    […] « Wohoo… New WordPress Change in Sidebar Add WeatherIcon 2.0 to it.    Fi […]

  73. Lee Marshall Says:

    I’m getting fedup with this now.. I’ve tried both versions, i’ve tried everyones suggestions for getting rid of the bullets, but the last suggestion …

    The Weather
    New York, NY’); ?>

    ….

    brought back an error message and messed up my site.

    Is there PLEASE, just one simple solution that works. Or which theme must I use before this thing will start displaying properly!

    Thank you in advance!

  74. Jeremiah Says:

    Lee:
    the solution you tried last should have worked.
    you can call the weather function with 3 variables:
    Weather Station, Before, After.
    you would use it like this:

    WeatherIcon(’Station’, ‘before’, ‘after’)

    if you don’t include the “before” and “after” it uses “<li>” and “</li>”.
    so if you leave a blank space for before (just empty quotes: ”) and make the “after” just a line break: ‘<br />’ that should work.
    email me with your station code and I will email you back the exact code you should be using.

    P.S. don’t copy and paste from here, wordpress is converting all the quotes into “smart” quotes, (the little curly left and right quotes) and you need straight quotes in the code. that’s most likely the problem you’re having with the New York Code. if you just retype it by hand it should work.

  75. Lee Marshall Says:

    Thanks Jeremiah. I’ve not used PHP for a long long time and it’s like looking at a foriegn language again. My station code is EGLC

  76. Jeremiah Says:

    DE asked:

    Question about the weather icons updating from day to night.

    WeatherIcon gets that information from the server, not the client.
    the Wordpress GMT offset option is used to let WeatherIcon know how many hours off from Greenwich Mean Time Your server is.

    you can turn on the “Cache Debug” to see what time Weather Icon currently thinks it is.

    You can access the wordpress GMT offset option under the Wordpress Admin interface >> Options >> General.

  77. Lee Marshall Says:

    For some reason i’ve been getting Clear Skies and 14C reports, when it is most defianately cloudy with showers outside. I’ve gone back to using the free version of http://www.liveweatherfeed.com/ - i’ll keep popping back here to check on a new release. But for now i can’t be pluging it in and see if it works!

  78. day Says:

    dear jeremiah..

    i used wp ver 1.5 but still have an error ; Warning: fopen(/home/../public_html/blog/wp-content/plugins/WeatherIcon/cache/metar_cache_LEBL.txt): failed to open stream: Permission denied in /home/../public_html/blog/wp-content/plugins/WeatherIcon.php on line 681

    what shoul i do.. thanks

  79. day Says:

    please somebody help me how to change F to Celsius… thanks

  80. Jeremiah Says:

    Day:

    you need to set the permissions on the “cache” folder to 777

    and you can change from F to C on the options page.. under The Wordpress Admin interface.

  81. Anonymous Says:

    Thanks for the plugin - I like it a lot.
    What I would wish for very much:
    Couldn´t the plugin also show the local time? That is something I would appreciate.
    And: Sunrise and sunset have to be manually corrected every now and then? Or is there a possibility to get that automatically done (I do not even know the correct dates usually)? How do you do that?
    Thanks again, the plugin is very good! Kind regards

  82. Marchal Says:

    Sorry, I forgot to add my personal data. I was the one asking about display of local time and automatic adjusting of sunrise and sunset times.

  83. 谋杀青春 Says:

    […] 折腾WP。 自从升级为WordPress 1.5.1以后,BAStats便不能再用。等安装完WeatherIcon之后,连OSA也挂了。所以,老板刚一走,便寻回这些插 […]

  84. Sylvain Says:

    Excellent plugin! Works great for me. I have a couple of questions, though:

    1)Can anyone tell me how to center it. I tried to add:

    .weather_title { font-weight: bold; }
    .weather { text-align: center; }
    .weather ul li { text-align: center; }

    to my theme’s “style.css” file (I couldn’t find any “wp-layout.css” file, so I assumed that’s the one Jeremiah was talking about), but nothing happened.

    2) Is there any way to make this work with the “polyglot” plugin? My blog is in three languages, so it would be nice if my readers could choose their prefered language.

  85. Sylvain Says:

    >Marchal

    I second that motion. Seriously, a plugin showing the local time would be really great. I have been using a Java script on my old webpage thinking it was showing the time in Japan, when I realized YESTERDAY it was merely matching the clock of the computer I was using… (sigh)

  86. Felicia Aldridge Says:

    Will this work with Windows 2000 Professional? I haven’t been able to get this thing going with my IIS server.

  87. Jeremiah Says:

    Marchal:
    the local time is doable, but I haven’t had time to work on the weather plugin in a while. Sorry. ;-(
    I will try and add that feature the next time a have a few moments to work on it.

    Sylvian:
    that should have worked. did you refresh the page after you added those lines?

    Felicia:
    if php works then it should work.. I don’t think I’m doing anything exotic in there.
    I have it running on windowsXP, but I’m using Apache. I don’t have any experiance with IIS. Sorry.

    –Jeremiah

  88. Jeremiah Says:

    oh, forgot these:

    Automatic adjusting of sunrise and sunset is probably doable, but difficult. I doubt that I will be trying that. I may look into it and see, but don’t hold your breath.

    and I’ve never used the polyglot plugin. I will have to look at it and see if it can be made to work.
    and unfortunantly, as with the other feature requests, I’m just short on time right now.
    the code isn’t all that complicated. if you know someone with some php skills, they could probably add those features for you.

    –Jeremiah

  89. lisa Says:

    I installed everything the way instructed, and am running WP 1.5, and I am getting this error when I turn on the plugged.

    Warning: fopen(/home/.sagan/daria/dariaunplugged.com/wp-content/plugins/WeatherIcon/cache/metar_cache_KSMF.txt): failed to open stream: Permission denied in /home/.sagan/daria/dariaunplugged.com/wp-content/plugins/WeatherIcon.php on line 681

    I am hosted on Dreamhost, and I remember them saying they were turning off a PhP function to eliminate security holes. Did they turn of my function? Can I run the plugin any other way if they did?

  90. Jeremiah Says:

    Lisa: see comment number 80

    –Jeremiah

  91. Peter Says:

    Hello i wait for the script start working but still nothing.
    I got the chmod cache 777 folder.
    I got there 0 size file:
    metar_cache_EPWA.txt
    This is Poland Warsaw.
    See it yourself :
    Warsaw, Poland

    * Weather data not available
    http://www.guistyles.com

  92. Sylvain Says:

    >Jeremiah

    It worked, thanx!

    >Peter

    Sometimes the weather station you’re requesting info from is not sending any, hence the “Weather data not available” message. The best way to test this is to use the original tag (i.e.
    Lufkin, Texas

    ), and see if you get the same results as on Jeremiah’s page: If you don’t, then obviously your settings are wrong. If you do, then the problem is with the Warsaw station.

    Hope this helps…

  93. Peter Says:

    Well it doesn’t work.
    I’ve test it from yesterday , with 3 region setup.
    Still * Weather data not available
    How to solve the problem ?

  94. Nat Says:

    i got an error,

    Warning: fopen(/home/twenty4/public_html/24hrz/wp-content/plugins/WeatherIcon/cache/metar_cache_VHHH.txt): failed to open stream: No such file or directory in /home/twenty4/public_html/24hrz/wp-content/plugins/WeatherIcon.php on line 681″
    how can i fix it? thx for help

  95. After thought » Getting Started with WordPress. Says:

    […] for WordPress, to do all sorts of wonderful tasks. For instance, one of these plugins, the WeatherIcon, offers a nice little list with weather information, as you can see in […]

  96. After thought » My WeatherIcon plugin problem fixed Says:

    […] Posted in WordPress at 11:11 am by Administrator I fixed my little problem with the WeatherIcon. I wanted to make the various weather icons I was using in my Weather a […]

  97. Cristian Manuel Ocampo Alarcón Says:

    how can i change my weather zone ??

  98. David Says:

    failed to open stream: Permission denied

    Error is caused by inability to connect to server and retrieve data. Usually this is server settings preventing the current retrieval method from working. I’m finding fopen/fsockopen are ‘going away’ but not instant-failing on my host, and curl doesn’t seem to be fairing much better. I might have to use my own HTML-retrieval class to make this work…

    -d

  99. Adam Says:

    Thanks for the great plugin! One little niggle, if you find the time to fix it (heh):

    Since the plugin gets the time from the server, it isn’t quite accurate if you’re showing the weather from multiple time zones. For example, on my site, I show my weather in NYC, and my sister’s weather in Melbourne. If it’s night here, it’s day there, but the weather plugin displays the day (or night) icons for both cities. The ideal behaviour would be for the plugin to get the weather local’s time from the weather data, or elsewhere if it’s not in the weather data.

    But it’s no biggie, it still tells me the weather! Thanks!

  100. Aimee Says:

    I am just amazed at the work that went into this. Stunned. The way you made it coincide with the NOAA…I’m just, well, floored (I snuck a peek at that php code - all I can say is daaaaaaang) and, by golly, it works beautifully!!!!

    Thanks for a really cool plug-in…the first I’ve been able to install without a single problem. I’m quite proud of myself :) And my hat goes off to you guys for being so smart :D Heh. Cool. Thanks.

  101. Matthew Reed Says:

    Hey Jeremiah, excellent work. I’m not sure if youve fixed the PNG alpha transparancy issue in Internet Explorer, but if you havent, I wrote a fix for it back in October 2004. Keep in mind I wrote this back during WP1.2, and pre-Weather 2.0.

    http://purelogik.com/personal/website/?p=3

    Thats the URL, if you’re interested.

    Also, I’m using the 1.5 Default theme, and as you may well know, the list items have a >> symbol next to them. This poses a problem for the weather icon itself, becasue it too is a list item.

    I dont really know where to edit the HTML to change the inline CSS for only that list item. Im guessing its in WeatherIcon.php, but from what I can tell, most of it is code for the Admin options page. If you could tell me what to edit, that would be great.

    Again, EXCELLENT WORK. I LOVE the options page.

  102. Matthew Reed Says:

    UPDATE: I THINK Ive narrowed it down to lines 498 - 504 in WeatherIcon.php. Is that where I would somehow tell the images list item to not use the list items symbol (set in styles.css)?

  103. Jeremiah Says:

    Matthew:

    You found it!

    specifically lines 499 and 505

    the $before and $after are defined as <li> and </li> respectivly.. just change those 2 lines and you should get the effect you’re looking for.

    –Jeremiah

  104. Matthew Reed Says:

    Yes, thank very much.

    It makes sense now. Those “tags” are defined once (as and ) somewhere else in the code as “$before” and “$after”, and wrap around each list item (if it is checked to display).

    Keep up the good work.

  105. Matthew Reed Says:

    Darn parsed HTML

  106. Bilal Says:

    Hi,

    I can’t seem to figure out how to display the stuff I want and stuff I don’t want. Like I only want “Temp, Clouds”. Nothing else. I checked the WeatherIcon.php and there was some bunch of stuff I was tempted to change, but didn’t as I didn’t wanna mess it up. Your help will be appreciated. :)

    Regards,
    Bilal

  107. Bilal Says:

    Also, how do I change the icons? Very sorry, forgot to add this question in the previous comment.

  108. Bilal Says:

    Ok I removed the stuff I wanted. So could you please answer 2 of my questions:

    1. How to change the spacing?
    2. How to change the icons? I want the other ones. The 2D ones.

    Thank you.

  109. Bilal Says:

    Ok nevermind, I found out how to change the icons and the displaying stuff. I’m very sorry for posting these comments again and again.

    My final question is how do I reduce the spacing? Check my site here : http://xeenat.com/wordpress

    I want the icon to be centered, and temp and clouds with the bullets I have. Doesn’t work for me. >.

  110. Peter Says:

    Well my plugins just say :
    Weather data not available

    But in the cache folder i have this :
    metar_cache_EPWA.txt

    I don’t know what is the problem , ale the configure things is good.

  111. Bilal Says:

    Peter, maybe your station isn’t working. The place where I live had 2 station codes and only one of them worked. =/

  112. Peter Says:

    No i try with the default , then change to another and nothing still that :
    Weather data not available

  113. Bilal Says:

    Try it again. Download the WeatherIcon2 again and follow the instructions.

  114. Chris Says:

    Hi. I have a REALLY dumb question here…

    I just upgraded to Wordpress 1.5.1.3 today and I installed this WeatherIcon plugin. I am all ready to go…but I can’t figure out for the life of me what file to paste the code into if I want it to display at the top of the sidebar to my blog. It’s right on the main page. I thought it would be index.php, but that didn’t work. Can anyone help?

  115. Jeremiah Says:

    Chris:

    in the wordpress admin upder “presentation” choose “Theme Editor”
    it’s the “Sidebar Template”

    –Jeremiah

  116. Liyun Li Says:

    Hi, I’m based in China and configured it ok. Problem is that it shows a night-time image when it’s really day time (I should know, I’m in the country!). I thought of swapping over the images from night to day, but wondered if there is an easier way to change the code?

    Thanks

  117. rossd.com Says:

    Current Weather Conditions

    I just finished adding the current weather conditions for Charlotte on the sidebar (see right under categories). It is rather nice, seeing as it does not get any information from Weather.com or another 3rd party source. It receives its conditions from…

  118. Anonymous Says:

    Hi from Denmark :-) (i guess that also explains my poor english …)

    I installed wordpress 4 days ago, and for the last 3 days i have been trying to install your weathericon plugin.

    I have tryed everything, but it just won work.

    When i see it on other blogs it looks great, and i would lige to put it on mine aswell. Actually the blog im setting up is for my little brother -he is moving to Irak, and it would be nice to have the weather in Irak to show on the page.

    I tried placing the php code almost everywhere. either nothing happens or i cant see the blog …

    Can anyone help me?

  119. Michael Says:

    The plug-in worked great, until I tried to set the options. All of the options were scrambled, and when I tried to save the options, the plug-in could no longer find my cache file, etc. because garbage data was written as its path.

    After hours of futzing, I realized the problem — the current version (2.0.1) uses short open tags for echoing the options. Unfortunately, the PHP server at my university has short_open_tags set to false.

    I did a find and replace in WeatherIcon.php, changing

  120. Alex Says:

    #114:
    I’m from Denmark too - just installed WordPress and WeatherIcon …. worked perfectly in the first try.

    Please send me a mail, and I’ll help you (in Danish) - we might want to work on a Danish localization at the same time :-)

  121. Robbie Liu Says:

    Hello

    i like it very much,but i am not using WP. Could i use it in a different blog program?

    Thank you very much!

    Regards

  122. Anders Says:

    Hi,
    Thanks for your neat weather plugin. I would like to disply the wind speed in meter/second. Is there some way to make that happen, and if so where in the code should I make changes? cheers,

  123. Luis Says:

    I’m getting this error but it still displays the info as you can see below. I’m running it on my IIS5.1 server at home. I’ve read the comments above and everyone keeps saying to chmod 7777. What is that? i don’t think thats something IIS5.1 words it.
    ————————–
    Warning: fopen(c:\inetpub\wwwroot/wp-content/plugins/WeatherIcon/cache/metar_cache_KHWO.txt): failed to open stream: Permission denied in c:\inetpub\wwwroot\wp-content\plugins\WeatherIcon.php on line 681

    Temp: 91°F
    Heat Index: 100°F
    Humidity: 56%
    Wind: ESE at 13 kt, gusting to 16 kt
    Dew Point: 73°F
    Barometer: 30.04″ Hg (1017 hPa)
    Clouds: partly cloudy
    Visibility: 10 miles
    —————————

    thanks

  124. Luis Says:

    never mind everyone I figured it out.

  125. Luis Says:

    How do take off the black background from behind? I think it would be nicer looking if it was a transparency without the black.

    thanks

  126. Jeremiah Says:

    Luis,

    Glad you got it working. I don’t have any experiance with IIS.

    for anyone else looking this was all I could find:
    http://www.1planhost.com/support/s_CHMOD-tutorial.asp

    the black background is caused by a flaw in internet explorer.
    it looks correct in any other browser.
    See comment #98 for an internet explorer fix.

    –Jeremiah

  127. Viper007Bond Says:

    RE: Comment #121

    Luis: You’re probably using IE. IE doesn’t support PNG transparency because IE is a piece of junk. Either convert it to GIF or switch to a better browser.

  128. Viper007Bond Says:

    Now for my comment:

    Why are you using NOAA or whatever? They’re reporting 70F here according to your plugin while Weather.com, WeatherUnderground.com, my home thermometer, and me are all reporting temps in the mid-80’s. I’m in Portland, OR BTW.

    You could also use Weather Underground’s RSS feed: http://www.weatherunderground.com/auto/rss_full/OR/Portland.xml

    Just have the user like drop in that URL into the function.

    I actually may decide to hack your plugin to use WU if NOAA keeps reporting the wrong temp. :(

  129. Garett Says:

    Viper007Bond: Feel free to hack away. The main problem is that the data is already translated into human readable format, which would require rewriting about 80% of the plugin, since it is designed to translate METAR data.

    Anders: Yes. First you’ll want to add a new wind_unit variable.

    Add this line around line 146 (may be different on yours, I’m not sure how far off baseline my code is right now):

    >Meters per Second

    put it between km/h and mph. This will allow you to select meters per second. Before doing so, though, we’ll have to fix the function speed, defined in the function get_wind (around line 676) and … errr, wait a second, somethings not right here …

    case ‘km/hMPS’:
    return round($part * 1000) . ” $wind_unit”;

    This line (around 713) is wrong. It should read
    case ‘km/hMPS’:
    return round($part * 3.6) . ” $wind_unit”;

    I must have been drunk when that line was written … or someone else wrote it. In any case, getting back to the code, we we are adding the following case statements into speed:

    // Convert to meters per second
    case ‘m/sKT’:
    return round(0.514 * $part) . ” $wind_unit”; // from knots
    case ‘m/sMPS’:
    return $part . ” $wind_unit”; // from meter/sec
    case ‘m/sKMH’:
    return round(0.278 * $part) . ” $wind_unit”; // from km/h

    Voila. Meters per second.

  130. Garett Says:

    Crap.
    HTML.

    Add this line around line 146 (may be different on yours, I’m not sure how far off baseline my code is right now):

    <option value=”m/s” <?= ($weather_settings[’wind_units’]==’mps’)?”selected”:”" ?>>Meters per Second</option>

  131. Garett Says:

    And there is a bug in the code *sigh* It should read:
    >Meters per Second

    PS: Sorry Michael for the short open tags, I completely forgot that that wasn’t standard PHP.

  132. Garett Says:

    HTML again … I’m really slow some days.
    <option value=”m/s” <?= ($weather_settings[’wind_units’]==’m/s’)?”selected”:”" ?>><?php _e(’Meters per Second’, ‘WeatherIcon’); ?></option>

  133. Garett Says:

    Viper007Bond: Actually, thinking about it, the WU RSS feed and the NOAA metar might work nicely side by side. Basically you’ll have to write new get_metar & process_metar functions (call them say get_wu_rss and process_wu_rss) and rename the existing ones to say get_NOAA_metar and process_NOAA_metar. Then add an option on the option page to select between them. The hard part still exists, but at least it wouldn’t result in a plugin split.

  134. Viper007Bond Says:

    Ooo, that’s not a bad idea combining the two. I had started work on just writing my own weather plugin, but I like your idea of combining the two.

    And here’s what I have so far (I’m calling the function at the bottom of the script for dev purposes): http://www.viper007bond