Weather Hack
I’ve added a local weather doo-dad, in the sidebar. I think it’s nifty.
You can view it with all options enabled here, and you can get the source and instructions to add to your own Wordpress site here.
let me know if you’re using it, or if you have any questions or problems here or in the comments.
Update: I’ve changed the link to point to a new file updated to be a plugin for wordpress 1.2 and up!
get it while the getting is good!
Update2: if you want just the weather.php file (without the language strings and icons) you can get it here.
Update3: if you want to change the language, you can edit the “language.php” file. here are some: contributed translations.
February 22nd, 2004 at 9:07 am
Hi Jeremiah, I am currently (still) running b2 on my site, but have a Wp test log, and am trying your weather hack there, I really like it, it´s brilliant!
Because I am not yet ready to convert to wp (too many hacks and entries to convert), I was wondering if there is any way to use the hack on a none wp site. Thank you in advance for a possible reply! 
February 22nd, 2004 at 1:15 pm
Oh I figured it out, thank you!
February 22nd, 2004 at 6:44 pm
Connie,
Saw your first comment too late to even try helping.. lol
Glad you got it working!
–Jeremiah
February 24th, 2004 at 9:54 pm
Dear Jeremiah, i tried your script.
But when i include in my-hacks.php this line:
include_once(’weather/weather.php’);
it shows the weather conditions on the home page even if i have not included the line:
< ?php show_wp_weather(); ?>
in my index.php
And, most of all it completely destroy the GUI.
What’s the prob ?
February 27th, 2004 at 8:02 pm
that’s pretty cool!
March 2nd, 2004 at 4:38 pm
Outstanding software! Installed it within a breeze.
March 3rd, 2004 at 12:21 am
Hi, i am testing your hack locally, very nice. Can one display the weather for more than one station?
March 3rd, 2004 at 8:23 am
Hmm. weather.noaa.gov seems to be completely hosed at the moment. So I can’t tell if the weather script is working for me or not.
March 3rd, 2004 at 5:45 pm
Eduardo,
Glad you like it!
The easiest way to display more than one station right now is just to
use more than one copy of the file.
TechGnome was saying that he might setup the station ID so that it could
be passed to the function.
You might check the wordpress forum and see if he’s done that..
I’ve been too busy of late to do anything more with it..
–Jeremiah
March 4th, 2004 at 4:57 am
weather.noaa.gov came back up and when it did, I saw that the weather script IS working for me.
Thanks!
March 4th, 2004 at 9:44 pm
Thanks, Jeremiah!
March 9th, 2004 at 11:27 am
Love it! Put it on one of the sites I maintain today, located at htttp://www.taeq.us/journal/. This was just what I was looking for! Awesome work!
March 17th, 2004 at 9:17 am
[…] he menu column you’ll see a new addition — a weather add-on for WordPress from Jeremiah. I implemented it without any problem, and had a look at the results in my b […]
March 17th, 2004 at 9:18 am
[…] he menu column you’ll see a new addition — a weather add-on for WordPress from Jeremiah. I implemented it without any problem, and had a look at the results in my b […]
March 17th, 2004 at 5:19 pm
Does it go out and fetch the file every time, or does it cache it somewhere to reduce traffic?
March 17th, 2004 at 9:18 pm
Monkey,
it fetches the file every time. it’s a very small file though.
Looks like this:
“2004/03/18 02:55
KLUF 180255Z 23005KT 20SM SKC 26/M03 A2983 RMK SLP087 WND DATA ESTMD 53003″
You can see the actual file that it fetches like this:
http://weather.noaa.gov/pub/data/observations/metar/stations/KLUF.TXT
(replace “KLUF” with whatever your station code is)
May 31st, 2004 at 8:26 am
I implemented simple caching.
Maybe this would interrest someone …
Here is the modified get_metar function:
function get_metar($station, &$wxInfo) {
//Add cache to speed up querying
$metar = false;
$process_request = false;
$info = false;
@$info = file('weather.txt');
if ($info)
{
if ( ( time() - $info[0] ) > 3600 ) //More than one hour ?
$process_request = true;
else
{
//echo "cached";
$metar = $info[1];
}
}
else
{
$process_request = true;
}
if ($process_request)
{
//echo "process";
$host = 'weather.noaa.gov';
$location = "/pub/data/observations/metar/stations/$station.TXT";
$request = "HTTP/1.1\r\n" .
"If-Modified-Since: Sat, 29 Oct 1994 09:00:00 GMT\r\n" .
"Pragma: no-cache\r\n".
"Cache-Control: no-cache\r\n";
@$fp = fsockopen($host, 80);
$request = "GET $location $request" .
"Host: $host\r\n" .
"Content-Type: text/html\r\n" .
"Connection: Close\r\n\r\n";
if ($fp) {
fputs($fp, $request);
if (strpos(fgets($fp, 1024), '200 ')) {
do {
$line = fgets($fp, 1024);
} while ($line != "\r\n");
while ($line = fgets($fp, 1024)) {
$metar = $line;
}
fclose($fp);
@$fptxt = fopen('weather.txt','w');
if ($fptxt)
{
fwrite($fptxt,time()."\n");
fwrite($fptxt,$metar);
fclose($fptxt);
}
}
}
}
return $metar;
}
May 31st, 2004 at 10:52 am
Thanks Slurdge!
June 5th, 2004 at 5:36 pm
[…] ed features: Kitty’s Spam Words plugin Spammers, you have been forewarned! Weather Outlook by Mambo, converted for Wordpress by Jeremiah, improved by TechGnome […]
June 25th, 2004 at 6:23 am
nice! works in php-nuke too, with little modifications !!
June 27th, 2004 at 8:13 am
Hi,
I have installed your great plugin. Is there an easy way to get a white background to the icon. My site is a light colour and I feel a lighter background to the icon would work better for me.
Thanks
Neil
June 27th, 2004 at 11:34 am
neil,
Actually, the icons have a transparent background.
Internet explorer just doesn’t handle them correctly.
firefox, mozilla, opera, and safari all handle the icons correctly.
Look here for a fix:
http://homepage.ntlworld.com/bobosola/index.htm
or check out the “instructions.txt”" file thats included with the plugin.
it has the info you need to use the gif images instead of the png’s if you want to.
–Jeremiah
June 27th, 2004 at 12:54 pm
Thanks for the fast response Jeremiah-I see that in firefox I have the desired effect ! I will check out your instructions further.
One more question…..I am in Luxembourg and my hosting company is Total Coice Hosting USA-I have my server differential time set to +6 hours-is this correct? I don’t think I am in phase with that setting?
Any help would of course be much appreciated
Neil
http://www.cyber6.org
July 13th, 2004 at 3:05 pm
Thanks Jeremiah for making a geat plugin. I left a reference of your site in my last post. By the way, I found it the easiest to just make the .png’s into .jpg’s with corresponding color backgrounds. That also cut the size down about 600%. Let me know what you think of my implementation.
http://www.oomonline.com
July 13th, 2004 at 3:16 pm
Sorry…I provided a dead link. I hate typos. Ps don’t mean to advertise, just like to get your opinion =)
http://www.oomsonline.com
July 16th, 2004 at 11:06 pm
I got it up and running on my site. Thanks for making this plugin! My blog is a work in progress, feel free to join.
http://sewaren.no-ip.com:24/blogs/netverkin
-Gabe
July 19th, 2004 at 9:40 pm
[…] […]
July 20th, 2004 at 2:33 pm
Thank you oh great prog for your time and effort to make this program plugin.And thanks for sharing.Thanks Again
Wih reg
whld
July 23rd, 2004 at 2:01 pm
First, this is a great plugin… good job. But I am having a slight problem that I can’t seem to resolve. I was hoping you could help. The plugin appears to be working fine (it does show the weather), with exception to one error… it can’t seem to find the cache file. I get a no such directory error. I’ve created the “weather_cache” folder and set the permissions, but it still can’t find it. Any ideas? Thanks.
July 23rd, 2004 at 2:26 pm
Never mind… I found the answer I needed on the wordpress forum… Thanks for the GREAT plugin!
July 25th, 2004 at 12:54 pm
Hmm, my problem as well. Gotta love it when people follow up with a ‘resolved’ comment but conviently forget to include a link to the answer they found.
July 27th, 2004 at 7:07 pm
I can’t find the specific post on wordpress that lead me to the answer, but basically the problem was solved by editing line 53 of ‘weather.php’ to be the real path to my ‘weather_cache’ folder. Of course adding the ‘weather_cache’ folder to the plugins folder is also important. I didn’t see that mentioned in the documentation. Another problem may have been the weather service text files. For San Francisco SFO (KSFO) seems to work better than the other one.
August 1st, 2004 at 12:36 am
I really like this plugin, but I really don’t like the html used to output it…
Rather than just whinge about it, I’ve made some improvements myself.
All ul’s/li’s are GONE. Location now appears as an h3, image is no longer nested inside anything else. All weather information is presented using the most semantically correct element for this case: a definition list. eg: Temperature is a
and the temperature reading is itsAll xhtml is now output with line breaks, so it results in much neater code
I'm only posting the section I've changed, but replacing this section of weather.php should be simple.
$weather =""; //This is the variable used to store the weather output.
$wxInfo['STATION'] = $station;
$wxInfo['TEMPERATURE'] = $temperature;
$wxInfo['CACHE_TIMEOUT'] = $cache_timeout;
$wxInfo['CACHE_DEBUG'] = $cache_debug;
$wxInfo['CACHE_PATH'] = $cache_path;
$metar = get_metar($station,$wxInfo);
process_metar($metar,$wxInfo,$visibility_unit,$wind_unit);
if ($metar==''||$metar==false||$metar==null||($wxInfo['TEMP_C']==''&&$wxInfo['TEMP_F']==''))
{
$weather = $weather . '
‘. $location. “
“._NOTAVAILABLE. “
“;
}
else
{
$weather = $weather . ‘
‘. “$location
\n”;
// icon
$no_night=0;
$now=gmdate( “H”, time()+$local_time*60*60 );
//Debug The Time
if ($wxInfo[’CACHE_DEBUG’]) {echo “
“;}
// fog
if ($wxInfo[’CONDITIONS_STATUS’]==’8′)
{
$wxInfo[’ICON’]=”1cloud_fog$icon_extension”;
$no_night=1;
}
// heavy snow
if ($wxInfo[’CONDITIONS_STATUS’]==’5′ && $wxInfo[’CONDITIONS_SEVERITY’]==’2′)
{
$wxInfo[’ICON’]=”4cloud_heavysnow$icon_extension”;
$no_night=1;
}
// light snow
elseif ($wxInfo[’CONDITIONS_STATUS’]==’5′ && $wxInfo[’CONDITIONS_SEVERITY’]==’1′)
{
$wxInfo[’ICON’]=”4cloud_modsnow$icon_extension”;
$no_night=1;
}
// snow
elseif ($wxInfo[’CONDITIONS_STATUS’]==’5′ && $wxInfo[’CONDITIONS_SEVERITY’]==’0′)
{
$wxInfo[’ICON’]=”4cloud_lightsnow$icon_extension”;
$no_night=1;
}
// general snow
elseif ($wxInfo[’CONDITIONS_STATUS’]==’5′)
{
$wxInfo[’ICON’]=”4cloud_lightsnow$icon_extension”;
$no_night=1;
}
// heavy rain
if ($wxInfo[’CONDITIONS_STATUS’]==’4′ && $wxInfo[’CONDITIONS_SEVERITY’]==’2′)
{
$wxInfo[’ICON’]=”4cloud_heavyrain$icon_extension”;
$no_night=1;
}
// light rain
elseif ($wxInfo[’CONDITIONS_STATUS’]==’4′ && $wxInfo[’CONDITIONS_SEVERITY’]==’0′)
{
$wxInfo[’ICON’]=”4cloud_lightrain$icon_extension”;
$no_night=1;
}
// rain
elseif ($wxInfo[’CONDITIONS_STATUS’]==’4′ && $wxInfo[’CONDITIONS_SEVERITY’]==’1′)
{
$wxInfo[’ICON’]=”4cloud_modrain$icon_extension”;
$no_night=1;
}
// thunder
elseif ($wxInfo[’CONDITIONS_STATUS’]==’2′)
{
$wxInfo[’ICON’]=”3cloud_thunders$icon_extension”;
$no_night=0;
}
// scattered clouds
elseif ($wxInfo[’CONDITIONS_STATUS’]==” && ($wxInfo[’CONDITIONS_SEVERITY’]==” || $wxInfo[’CONDITIONS_SEVERITY’]==’0′) && $wxInfo[’CLOUDS_STATUS’]==’2′)
{
$wxInfo[’ICON’]=”2cloud_norain$icon_extension”;
$no_night=0;
}
// mostly cloudy
elseif ($wxInfo[’CONDITIONS_STATUS’]==” && ($wxInfo[’CONDITIONS_SEVERITY’]==” || $wxInfo[’CONDITIONS_SEVERITY’]==’0′) && $wxInfo[’CLOUDS_STATUS’]==’3′)
{
$wxInfo[’ICON’]=”3cloud_norain$icon_extension”;
$no_night=0;
}
// partly cloudy
elseif ($wxInfo[’CONDITIONS_STATUS’]==” && ($wxInfo[’CONDITIONS_SEVERITY’]==” || $wxInfo[’CONDITIONS_SEVERITY’]==’0′) && $wxInfo[’CLOUDS_STATUS’]==’1′)
{
$wxInfo[’ICON’]=”1cloud_norain$icon_extension”;
$no_night=0;
}
// clear skies
elseif ($wxInfo[’CLOUDS_STATUS’]==’0′)
{
$wxInfo[’ICON’]=”0cloud$icon_extension”;
$no_night=0;
}
// overcast
elseif ($wxInfo[’CLOUDS_STATUS’]==_OVERCAST)
{
$wxInfo[’ICON’]=”4cloud_norain$icon_extension”;
$no_night=1;
}
// if night, icon is different
if((intval($now)>=$sunset_hour && intval($now)< ='24' || intval($now)>= ‘0′ && intval($now)< =$sunrise_hour) && !$no_night) $wxInfo['ICON']= "n_".$wxInfo['ICON'];
// debug
//echo "Cond status ".$wxInfo['CONDITIONS_STATUS']." Cloud stat ". $wxInfo['CLOUDS_STATUS']." Cond severity ".$wxInfo['CONDITIONS_SEVERITY'];
/////////
if ($use_icon_status == 'yes' && $wxInfo['ICON']<>”) $weather = $weather . “
\n
“;- ” ._TEMPERATURE.”
- “.$wxInfo[’TEMP_C’].”°C
- ” ._TEMPERATURE.”
- “.$wxInfo[’TEMP_F’].”°F
- ” ._WIND_CHILL.”
- “.$wxInfo[’WIND CHILL’].”
- ” ._HEAT_INDEX.”
- “.$wxInfo[’HEAT INDEX’].”
- ” ._HUMIDITY_W.”
- “.$wxInfo[’HUMIDITY’].”
- ” ._WIND.”
- “.$wxInfo[’WIND’].” $wind_unit
- ” ._DEWPOINT.”
- “.$wxInfo[’DEWPT_C’].”°C
- ” ._DEWPOINT.”
- “.$wxInfo[’DEWPT_F’].”°F
- ” ._BAROMETER.”
- “.$wxInfo[’BAROMETER’].”
- ” ._CLOUDS.”
- “.$wxInfo[’CLOUDS’].”
- ” ._CONDITION.”
- “.$wxInfo[’CONDITIONS’].”
- ” ._VISIBILITY.”
- “.$wxInfo[’VISIBILITY’].”
if ($display_temperature == ‘yes’)
{
if ($temperature==’C') $weather = $weather . “
\n”;
else $weather = $weather . “
\n”;
}
if ($display_wind_chill==’yes’ && $wxInfo[’WIND CHILL’]<>”) $weather = $weather . “
\n”;
if ($display_heat_index==’yes’ && $wxInfo[’HEAT INDEX’]<>”) $weather = $weather . “
\n”;
if ($display_humidity==’yes’ && $wxInfo[’HUMIDITY’]<>”) $weather = $weather . “
\n”;
if ($display_wind==’yes’ && $wxInfo[’WIND’]<>”) $weather = $weather . “
\n”;
if ($display_dew_point == ‘yes’)
{
if ($temperature==’C') $weather = $weather . “
\n”;
else $weather = $weather . “
\n”;
}
if ($display_barometer==’yes’ && $wxInfo[’BAROMETER’]<>”) $weather = $weather . “
\n”;
if ($display_clouds==’yes’ && $wxInfo[’CLOUDS’]<>”) $weather = $weather . “
\n”;
if ($wxInfo[’CONDITIONS’]<>”) $weather = $weather . “
\n”;
if ($display_visibility==’yes’ && $wxInfo[’VISIBILITY’]<>”) $weather = $weather . “
\n”;
$weather = $weather . “
\n”;
}// else
echo $weather; // This is the call that writes out the content.
} // End WeatherIcon Function
little plugin.
August 1st, 2004 at 12:38 am
AAAAHHHH!!! I put it all inside <code> tags and it STILL got chewed up!
Jeremiah: Email me if you want the code.
August 1st, 2004 at 12:29 pm
Paul: Yeah, I fixed mine after staring at it today. I had an extra space before the opening slash in my absolute path. Works now!
August 4th, 2004 at 6:26 pm
More Weather
WeatherMoreIcon(’EGPH’,'Edinburgh,Scotland’);
WeatherMoreIcon(’EGLC’,'London,England’);
WeatherMoreIcon(’KNYC’,'New York,New York’);
Updated and cached every 30 minutes.
Locations: Edinburgh Airport, London City Airport and…
August 6th, 2004 at 2:28 pm
Great plugin! Only thing I wonder is possible is to have the plugin return some type of default “the plugin is disabled” type of text rather than getting a PHP error if it’s disabled?
August 6th, 2004 at 7:01 pm
Good Stuff, almost got it the way I like. Having a little trouble.
How do you get rid of the dots/bullets in front of the weather?
Also how do you bold the weather titles?
I tired adding;
.weather_title { font-weight: bold; }
.weather { text-align: center; }
.weather ul li { text-align: center; }
to my “wp-layout.css” file, but no go.
August 6th, 2004 at 11:08 pm
Ok here’s my solution for when the plugin is deactivated: checking to see if the WeatherIcon function exists before calling it. Here’s my modified code in index.php to check it:
< ?php if(function_exists(WeatherIcon)) { WeatherIcon('KJAX','Jacksonville, FL'); } ?>
If the plugin is deactivated, the space where the weather would normally be displayed is simply *poof* gone. Activate the plugin and it’s back.
August 6th, 2004 at 11:11 pm
Grr… forgot that code inside a <code&gr; tag vanishes if not formatted
<?php if(function_exists(WeatherIcon)) { WeatherIcon('KJAX','Jacksonville, FL'); } ?>
August 12th, 2004 at 12:17 pm
Kenny, try this:
.weather li { text-align: center; list-style-type: none; }
August 18th, 2004 at 5:26 pm
Great job! Much simpler than the Weather_Services Pear component. What license is this released under? Can I safely use this on commercial sites?
August 19th, 2004 at 7:52 am
Scott:
Thats pretty cool! Thanks!
Joe W.:
License is GPL.
I don’t foresee any problems with using it on a commercial site.
–Jeremiah
September 7th, 2004 at 1:17 pm
Jeremiah,
What would I need to do to run this as a stand-alone script (outside of WP) or embedded in a non-WP page? I use ExpressionEngine and would love to use your plug-iin with my EE-based sites either by embedding the PHP or, if you’d allow it, converting your script into an EE plug-in.
Thanks.
-Seth
September 7th, 2004 at 5:59 pm
Seth,
It’s really not very dependent on wordpress.
just do a php include for the main file like this: “include_once(’weather.php’);”
into the page that you want the weather to appear on, and then follow the instructions that are in the download.
thats pretty much it.
if you have any trouble, let me know. but that should work.
–Jeremiah
September 7th, 2004 at 10:03 pm
Wordpress Weather Plugin for ExpressionEngine
NOTE: All of these instructions use an example URL of http://www.example.com. Change these URL references to your server address as necessary. NOTE: Jeremiah's original Wordpress plugin did not contain the /weather-plugin/weather_cache folder …
September 10th, 2004 at 12:57 am
Nice weather mod!
Got it up and running on my blog rYnoweb .com
Good work!
September 14th, 2004 at 3:05 pm
Very nice work. Added it to my site and love the results. Thanks.
September 26th, 2004 at 4:16 pm
I installed it. It gets the information but I can’t get rid of an error. I have tried what I can think of with the cash but my idea’s don’t seem to work. I currently took it off my site until it is figured out but this is the error.
Warning: fopen(http://www.woolever.com/wordpress/wp-content/plugins/weather_cache/metar_cache_KUGN.txt): failed to open stream: HTTP wrapper does not support writeable connections. in /home/wooleve/public_html/wordpress/wp-content/plugins/weather.php on line 259
If you have any suggestions I would appreciate it. It seems like a simple fix but I am missing something
Aaron
September 28th, 2004 at 6:24 pm
Can this be used with MT at all? I don’t use (nor like) WP, but i LOVE this plugin and would really like to implement it on my MT blog. Thanks!!
October 6th, 2004 at 7:01 pm
great job on the plug-in. really like it. didn’t read through the posts above, but i noticed on your page you have a “feels like” entry - not finding it in the code? is it also available?
October 7th, 2004 at 3:12 pm
I think before this becomes a huge issue, someone might leave some information on how to find your local weather code if you don’t live in the U.S.
I live in Montreal, Quebec in Canada. So far I can’t locate any weather code relevant to this plugin for my area.
October 7th, 2004 at 5:44 pm
your weather plugin is slick! But do you notice the icon background interlace is black when displed on IE? It display just fine in Firefox, which is transparent. But hey, Fireox is the best, so….
Thanks a lot.
Pay my site a visit sometime if you will, and write smth down in the guestbook. I would really appreciate it
Alvin
October 7th, 2004 at 8:24 pm
Paolo:
did you try here?:
http://weather.gov/tg/siteloc.shtml
these are the stations I found:
Montreal / Dorval International, Que (71627, CYUL)
Montreal / Mirabel (—–, CYMX)
Montreal River Radar Site (—–, CWGJ)
–Jeremiah
November 1st, 2004 at 9:27 am
Hi,
Is it possible to display both fahrenheit and celsius temps?
November 4th, 2004 at 3:17 pm
i am not sure what to put into the cache path…..
can someone help me?
November 4th, 2004 at 4:17 pm
I’m trying to use this plugin on a wordpress page hosted on an intranet. I’ve tried three weather plugins now that query outside weather sources (obviously) and none of them work. I keep getting errors that eventually turn out to “weather data not available.” I can’t imagine why there would be a problem querying another website since I can link to outside sites just fine, but I’m just having no luck. Any suggestions would be much appreciated.
-Brandon
November 12th, 2004 at 10:11 am
The results returned by this hack are a little odd and differ from other weather programs that use NOAA.
At the moment I see Conditions: mist and the icon shows 4cloud_norain but looking at the cache file I see
KDCA 121351Z 05006KT 2 1/2SM RA BR BKN009 OVC014 08/07 A3023 RMK AO2 SLP235 P0018 T00830067
Shouln’t the RA indicate rain? (It’s pretty wet out side
November 16th, 2004 at 2:36 am
hi, okays, i am not the best computer person so i dont really know how to do this weather thing… i am so confused… errr..is there some other way to do this or can i get a walk-through/ step by step help?? hehe.. thanks.
ps: i am just lousy that way…heheh *grinn*
November 16th, 2004 at 1:33 pm
Hi,
I wanted like Seth to use the Weather-Plugin outside WP. But that doesn’t work. I include weather/weather.php which ist together with and the language.php and the pics in a folder called weather, but nothing to see. Can you help?
November 22nd, 2004 at 4:12 am
http://weather.noaa.gov/pub/data/observations/metar/stations/LFQQ.TXT
index.php
??? text ???
SVP
December 1st, 2004 at 12:24 am
Good morning, I am new to this site. I have just learned about this site. I am going to read on and it’s very interesting to know
December 2nd, 2004 at 9:48 pm
Thanks to Luc-Marie there is now a french translation of the language.php file for Weather Icon (the wordpress plugin displaying the current conditions that you see to […]
December 13th, 2004 at 8:55 pm
Hi!
Just to say that I’m using your weather hack in my blog, (not wordpress, just a simple home made php scritp ^^), at it works just fine
Thanks
December 16th, 2004 at 10:59 am
1.2.1 innan sÃ¥ det var inga större problem. Det enda som var lite struligt var att mitt Weather plugin stulade lite. Vet inte om det var slumpen som gjorde att det kajkade u […]
December 18th, 2004 at 3:03 am
12/18/2004 weathericon Filed under: plugins — site admin @ 5:02 pm Download from here On index.php insert between any li tags in “menu” eg […]
December 21st, 2004 at 12:27 am
This is a great plugin. Thank you for developing it and distributing. I really like the icons too. Question: Is there a version that doesn’t include the html output? I’d love a version of the function that would return an array with my desired data… any thoughts? thanks.
December 21st, 2004 at 2:11 am
Got it… you can just return the wxIcon array from the weathericon function…
January 2nd, 2005 at 7:47 pm
I’m using two locations, each with their icon of course, on the same page.
When one of the locatians enters nighttime and starts using the nighttime icons, the other location (wich is 6 hours back) starts using nighttime icons as well.
One of the reasons I’ve put them next to one another is to show a sun icon where the other uses nighttime to visually show the difference between the 2 locations.
Did I misconfigure something or is it something else?
January 2nd, 2005 at 9:50 pm
Catcher:
You need to comment out the line that reads:
$local_time = '-5'; ...(Around Line 58)Then change the line that reads:
function WeatherIcon($station='KLFK', $location='Lufkin, Texas') {(Around line 36)to read like this:
function WeatherIcon($station='KLFK', $location='Lufkin, Texas', $local_time = '-5') {then having done that, change the call on your page to include the GMT offset like this:
php WeatherIcon('KLFK','Lufkin, Texas','-5')Hope that helps.
–Jeremiah
jeremiah AT sonicpling.net
January 3rd, 2005 at 3:44 am
Thnx very much for the quick response Jeremiah.
It works fine now after I made the adjustments.
Thnx for this awesome plugin
Are you planning to put in a display date function in the future?
I’m using an extra Jvscript to this now.
January 4th, 2005 at 7:42 pm
Catcher:
I wasn’t planning on adding a date function, but it would be trival in php.
see here (second comment down): http://us4.php.net/manual/en/function.gmdate.php
and here for some more formatting options: http://us4.php.net/date
January 5th, 2005 at 6:09 am
I am not using Wordpress, but rather b2 and I tried to initiate the plugin by calling the file and then inputting the line of code from the Instructions file. I get this error on my page.
Warning: fopen(): open_basedir restriction in effect. File(/home/youruser/public_html/wordpress/wp-content/plugins/weather_cache/metar_cache_KNYC.txt) is not within the allowed path(s): (/home/lastpage/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/lastpage/public_html/blog/weather.php on line 313
Warning: fopen(/home/youruser/public_html/wordpress/wp-content/plugins/weather_cache/metar_cache_KNYC.txt): failed to open stream: Operation not permitted in /home/lastpage/public_html/blog/weather.php on line 313
# Conditions Debug
That appears in the sidebar where the weather image should show up. I get all the details but I think something went a bit wrong. If someone could please look at it and check it out. My site is at: http://www.thelastpageonthenet.com
January 7th, 2005 at 6:38 pm
thanks for this module !
January 9th, 2005 at 6:27 am
Hi!
After I’ve inserted your weather plugin my blog homepage doesn’t validate ad valid XHTML 1.0 transitional…
it says:
document type does not allow element “li” here; missing one of “ul”, “ol”, “menu”, “dir” start-tag
…
<li id="weather-LIBD" class="weather">Bari,Italy<ul><li><img src="http://www
Any hack to fix this?
January 12th, 2005 at 6:05 pm
The path to my webserving directory has a tilde ~ in it, so when I add ~ in the path to the icons folder it gets changed to %7E when served and therfore the image is broken, how do I get around this?
January 12th, 2005 at 6:08 pm
Mat:
I tried adding a tilde into my path here and it came out ok.
can you point me at an example, or email me your weather.php file?
jeremiah AT sonicpling.net
January 12th, 2005 at 8:24 pm
This is a really great, and easy to use plug in. I’ve recently modified it a bit (and drawn my own icons) to use in my “header”. I’ve had a problem, in that it doesn’t seem to understand that it’s night when it invokes the “4cloud_norain” image. Other than that, Great work!
January 16th, 2005 at 4:41 pm
Woo hoo! Just got this working on my test site using WP 1.5 Beta. Works just the same as in 1.2, which is a Good Thing :-).
Thanks again for developing this really nice plugin.
January 18th, 2005 at 12:43 am
Hi Jeremiah,
This is a great plugin and I really like the images you have with them. One problem is that I keep getting the error about weather data not being avaialable when I use OPRN for Islamabad Pakistan. On the NOAA site they have current weather info however for Islamabad. Right now I’m using the Get Weather plugin because that allows me to use codes from weather.com for getting the weather. Is there something that I’m doing wrong ? Please help when you get a chance! Thanks a lot!
January 20th, 2005 at 12:42 am
Warning: weathericon(language.php): failed to open stream: Permission denied in /home/.valdezheater/tmac/muonproof.com/wp-content/plugins/weather.php on line 76
Warning: weathericon(): Failed opening ‘language.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /home/.valdezheater/tmac/muonproof.com/wp-content/plugins/weather.php on line 76
Warning: fopen(http://muonproof.com/wp-content/plugins/weather_cache/metar_cache_CYGK.txt): failed to open stream: HTTP wrapper does not support writeable connections. in /home/.valdezheater/tmac/muonproof.com/wp-content/plugins/weather.php on line 313
What permissions does this stuff have to be?
January 20th, 2005 at 9:45 pm
K I’m somewhat bewildered here, when I install the weather.php I get this message,
Warning: fopen(/home/youruser/public_html/wordpress/wp-content/plugins/weather_cache/metar_cache_KCHS.txt): failed to open stream: No such file or directory in /home/hterry3/public_html/wp-content/plugins/weather.php on line 313
now line 313 is if ($fp = fopen($metar_cache, “w”)) {
am I to just make a blank file named this or what?
January 22nd, 2005 at 9:28 am
I get that error.
Warning: fopen(/home/enmg/public_html/wordpress/wp-content/plugins/weather_cache/metar_cache_KUCA.txt): failed to open stream: No such file or directory in /home/enmg/public_html/maxedout/wp-content/plugins/weather.php on line 313January 22nd, 2005 at 11:55 am
pzgamer,
1. create a folder inside your “plugins” folder and call it “weather_cache”
2. set the permissions on the “weather_cache” folder to 777
3. open the “weather.php” file and change line 66 from this:
$cache_path = '/home/enmg/public_html/wordpress/wp-content/plugins/weather_cache';to this:
$cache_path = '/home/enmg/public_html/maxedout/wp-content/plugins/weather_cache';that should solve it.
–Jeremiah
January 23rd, 2005 at 3:27 am
can anyone make a workaround how to handle this script for a non wordpress user?
can lycos handle the weather_cache
January 25th, 2005 at 12:18 pm
Hi.. Saw your plugin but is it available for New Delhi, India? I cant find the location to add..
January 25th, 2005 at 2:31 pm
Great plugin, once I stopped being difficult!
Thanks!
January 28th, 2005 at 5:22 pm
Thanks for making this plugin I really like it! I used it on my old blog which was just my individual blog. But I wanted to have my grandpa and my brother write too so I created Enduring Voices. Now with the runphp plugin and your plugin we can have the weather in each user’s profile. Very cool.
I used it in my profile here at http://enduringvoices.com/wptest/
February 5th, 2005 at 12:32 pm
tware: Wordpress v1.5 Beta (Freeware) Template: Conestogastreet by Theron Parlin Plugin 1: WeatherIcon v1.9 Plugin2 : Comment Analysis v1.2 No Comments » […]
February 10th, 2005 at 4:01 pm
Hi,
First of all - it’s a great plugin :-). Got it installed, but I do have some problems with my CSS connected to it. Hope that someone here can help me out. If you take a look at http://sean.journeypix.com, you will se that it display the weather on the sidebar. What I would like is:
- Get away the bullet in front of the city and country title.
- Get the weather image in center
- Avoid that all the headline titles (like search and so on) get centrated.
Also tried to figure out how to add two cities to the same page. Tried to put two functions with cities but then I got a error.
I appreciate any help!
Thanks.
February 16th, 2005 at 4:23 am
Hi, I like the look of your weather plugin and wanted to try and get it working on my non-wp site. I put < ?php include_once("weather.php"); ?> in my index.php but I get this error “Parse error: parse error, unexpected T_VARIABLE in /home/miijo/public_html/weather/weather.php on line 49″. Is there something else I need to do to get this working? Thanks.
February 17th, 2005 at 2:41 pm
Really enjoying the plugin, but I am having some diffciulty finding a way to removing the bullet from the weather icon. I tried Scott’s tip in 42, but didn’t do the trick. I am thinking it may have something more to do with the setup of my site through the CSS file. I’m currently using WP 1.5 w/ the default (Kubrick template). Can anyone help?
February 18th, 2005 at 1:00 pm
Greta plugin! Have you thought about creating one using TAF format for forecasts?
Thanks!
February 19th, 2005 at 10:31 pm
OK, nice plug-in but how to change Farenheit to Celsius?
February 20th, 2005 at 11:22 am
« HTML Validator WP weather plugin Installed a weather plugin for WordPress today. You can see on the right side of […]
February 21st, 2005 at 9:02 pm
uds: overcast P O V Talking to myself…. Added the Weather Plugin from Jeremiah tonight. Pretty nifty; now all I have to do is come up with real area photo […]
February 22nd, 2005 at 3:55 pm
Using your comments to Seth, above, I successfully installed this applet on a site which uses php includes - works great, and thanks for the ease of use! (I had the same problem as your weather plugin shows above earlier - had to manually delete the cache file to fix it….)
February 24th, 2005 at 11:55 pm
Jeremiah, what would be the possibility of somehow munging in a way to display the moon’s phases with this?
February 25th, 2005 at 12:36 am
Hey Jeremiah - works great, thanks for the awesome plugin!
I also agree with Vkaryl - that would be a great feature, although probably pretty complicated, eh?
Thanks!!
February 26th, 2005 at 2:37 pm
ilable here: weather.phps if you want the whole shebang (icons and all), then check here: weather-hack.
No Comments
»
No co […]
February 26th, 2005 at 5:18 pm
y Matthew at guestblock.com). I also would like a weather icon thing as well. I quite like Jeremiah’s plugin. It’s clean and customisable and seems to sit happily i […]
February 26th, 2005 at 5:18 pm
y Matthew at guestblock.com). I also would like a weather icon thing as well. I quite like Jeremiah’s plugin. It’s clean and customisable and seems to sit happily i […]
February 27th, 2005 at 3:50 pm
I have been using version 1.1.7 and now 1.1.10 and works great but every so often I get this error message (in both versions).
Warning: fread(): Length parameter must be greater than 0. in /www/k/mysite/htdocs/wp-content/plugins/weather.php on line 285
I’m using weather from Syracuse, NY: KSYR
Just wondering if anyone knew about this error? Thanks for the pluggin!
February 27th, 2005 at 11:01 pm
Kenny - had that a couple of times. Going into the weather_cache folder and deleting the files in it seems to fix.
March 1st, 2005 at 4:03 am
ugin Aggiunti alcuni nuovi plugin, ma di questi solo sia weighted_categories che weather MA anche image-headlines, sembrano funzionare. E’ proprio vero che non […]
March 4th, 2005 at 4:53 pm
I’m using the plugin to display weather for a small uk market town in warwickshire. Though the reference point i have used isn’t quite ‘on target’, thats the only criticism i have! everything else has been a sinch. good work!
March 6th, 2005 at 9:50 pm
I am using this plugin on my website at http://www.uberpink.net. I love it! I am having a lot of issues with it working with my template (The Default template on WordPress) because it is wanting to use the bullets that my template uses for the rest of the sidebar and I dont want it to use the bullets at all. I’m not exactly sure where I need to change this at! I’ve tried it in the CSS and everything!
March 7th, 2005 at 3:14 pm
Candace: here’s the relevant meta info from my redone stylesheet. Note please that I don’t use bullets anywhere, so the following css removes them all….
.meta li, ul.post-meta li {
display: inline;
padding: 6px 0;
}
.meta ul {
display: inline;
list-style: none;
margin: 0;
padding: 0;
}
March 7th, 2005 at 5:10 pm
Getting an common error, and I tried everything suggested with no luck.
Warning: fopen(/home/theruse/public_html/wp-content/weather_cache/metar_cache_KFAT.txt): failed to open stream: No such file or directory in /home/theruse/public_html/wp-content/plugins/weather.php on line 315
No icon showing up either.
-DR
March 7th, 2005 at 9:39 pm
Candace: should have thought to point out that I’m using the Quentin theme from http://www.pikemurdy.com, and not the default…. Sorry.
March 9th, 2005 at 9:34 am
Great job! Thanks so much. I was able to get it working wonderfully with MT3.x [should work just as well with 2.x]. If anyone needs info on how to do it, shoot me an email at chariATcdaigDOTcom.
March 10th, 2005 at 7:24 am
ather, and is available here. Matt also tried to get one yet stumbled across this one - Weather hack; I think the icons are better but he’s had a bit of problem gettin […]
March 10th, 2005 at 4:42 pm
ción muy buena. BBCode - Añade soporte para el código BBCode que se usa en muchos foros. WeatherIcon - Este es algo más complicado de usar y es el que da soporte al bloque de […]
March 19th, 2005 at 6:59 pm
Hi Jeremiah,
Great plugin :). I’m having an odd issue though. I want to use the .png icons in /wicons/ but for some odd reason, they don’t even load up at all. I am using Opera too, also checked in Firefox. I uploaded them to the correct folder location, but when I try to view any of them, they don’t load at all. I have them stored at mindwiped.com/gurlrider/wp-images/wicons/ … is there a specific manner of uploading them that I am missing? They show up fine too when I browse the folder with them on my harddrive via Thumbnail browsing. Any clue as to how to resolve this? Should I try uploading them in a specific Transfer Type; ASCII or Binary? Any help would be grealty appreciated with this issue.
Bob
March 19th, 2005 at 7:06 pm
Nevermind that last post Jeremiah. I reuploaded them in BINARY transfer type and they worked :). You might wanna add that to the instructions as a noted tip just in case anyone else comes across that same minor issue heh.
Thanks again for the kickass plugin