AccuWeather script & templates

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
zoltar
Posts: 4
Joined: Tue Aug 30, 2005 5:17 am

#16 Post by zoltar » Thu Sep 01, 2005 8:17 am

If anyone is interested I have european verison of this stuff (metric units + corrected location parameter passing)

User avatar
sumsum
Cacti User
Posts: 68
Joined: Mon Apr 26, 2004 7:18 am
Location: Switzerland
Contact:

#17 Post by sumsum » Thu Sep 01, 2005 8:37 am

i'm interested in a european version.
cheers
tom
http://www.lounge-radio.com/

wvr120364
Posts: 16
Joined: Tue May 06, 2003 7:48 am

#18 Post by wvr120364 » Mon Oct 24, 2005 3:47 pm

@zoltar,
I'm also interested. Could you send it to me.

Wietze

thogan
Posts: 6
Joined: Thu Oct 06, 2005 9:14 am

AccuWeather Graphing Problems

#19 Post by thogan » Mon Aug 14, 2006 10:27 am

I noticed a couple of days ago that my graphs for AccuWeather are no longer showing the temperature or RealFeel values. Has anyone else seen this problem? Did they change the layout of their page?

User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

#20 Post by Instigater » Tue Aug 29, 2006 1:38 am

Updated Accuweather script. Based on PHP and using metric values.

Installation:
1. Put accuweather.php in scritpts folder
2. Edit variable $file on second line to represent your location
3. Upload host template

Be aware that this scripts is for one minute polling interval!
Attachments
accuweather.php.gz
(1 KiB) Downloaded 1008 times
cacti_host_template_weather_server.xml.gz
(4.48 KiB) Downloaded 1033 times
accuweather.jpg
accuweather.jpg (66.8 KiB) Viewed 13706 times

User avatar
morgentau
Posts: 39
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

I get an error

#21 Post by morgentau » Wed Aug 30, 2006 2:51 am

I adjusted your script like this:
<?php
$file = "http://forecastfox.accuweather.com/adcb ... orecastfox";
$stack = array();
$masivs = array();

on the command line a get the following error:

/srv/www/htdocs/cacti/scripts # ./accuweather.php
./accuweather.php: line 1: ?php: No such file or directory
./accuweather.php: line 2: =: command not found
./accuweather.php: line 3: syntax error near unexpected token `('
./accuweather.php: line 3: `$stack = array();'


what could be causing this errror?

User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

#22 Post by Instigater » Thu Aug 31, 2006 10:53 am

it is not executable, you have to execute php and pass this file as argument like this one:

Code: Select all

 /<path_to_php>/php ./accuweather.php

User avatar
morgentau
Posts: 39
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

#23 Post by morgentau » Fri Sep 01, 2006 3:07 am

Thank's a lot !!! If only i would have known...

Now i have a different error message. I checked the URL and get a XML file back with lot's of weather data but my graphs are still empty and on the cmd i get this error:

Code: Select all

Warning: fopen(http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR;CH;SZ026;ZURICH;&metric=1&partner=forecastfox): failed to open stream: Connection refused in /srv/www/htdocs/cacti/scripts/accuweather.php on line 31
in this line i see this:

Code: Select all

$xml_parser = xml_parser_create();
29: xml_set_element_handler($xml_parser, "startElement", "endElement");
30: xml_set_character_data_handler($xml_parser, "cData");
31: if (!($fp = fopen($file, "r"))) {
32: die("could not open XML input");
}
What can i do to get the graphs working?

User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

#24 Post by Instigater » Fri Sep 08, 2006 3:26 am

Your PHP settings in php.ini doesn't allow to open files on remote servers.

User avatar
morgentau
Posts: 39
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

How can i change this?

#25 Post by morgentau » Thu Oct 05, 2006 3:39 am

Back from a long break i would like to make this weather graphs work.
How can i change the php.ini settings?

JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

#26 Post by JJX » Thu Oct 05, 2006 8:14 am

wvr120364 wrote:@zoltar,
I'm also interested. Could you send it to me.

Wietze
is possible to attach it to the forum? thx



Also, one more question.
Is possible to graph more than one locations??
cacti rulez!

romanmir
Posts: 4
Joined: Wed May 31, 2006 6:07 pm
Contact:

#27 Post by romanmir » Mon Nov 13, 2006 1:45 pm

Instigater wrote: 2. Edit variable $file on second line to represent your location
3. Upload host template

Could anyone point me in the right direction for how represent my location field-wise in the second line?

spoonman
Cacti User
Posts: 298
Joined: Tue May 03, 2005 8:54 am
Location: GA

#28 Post by spoonman » Thu Nov 16, 2006 10:53 am

same here??? How do you define a location elsewhere ...US for example..

also in the echo statement at the end how can you put a carriage return to return you promt to a new line after all variables are presented??

echo "temperature:".$temperature." humidity:".$humidity." windgusts:".$windgusts." windspeed:".$windspeed." visibility:".$visibility." realfeel:".$realfeel." uvindex:".$uvindex." pressure:".$pressure ; <<< new line??

romanmir
Posts: 4
Joined: Wed May 31, 2006 6:07 pm
Contact:

Hmmm...

#29 Post by romanmir » Thu Nov 16, 2006 6:14 pm

After banging my head on trying to figure what the codes mean, I tried a couple of different combos..

This returns data for where I am:

http://forecastfox.accuweather.com/adcb ... orecastfox


At least it looks sane.. gonna test it out over the next few days, I hope to be able to narrow it down to zip codes.

spoonman
Cacti User
Posts: 298
Joined: Tue May 03, 2005 8:54 am
Location: GA

#30 Post by spoonman » Fri Nov 17, 2006 8:58 am

That looks perfect to me, I tried changing the link to fit my area in GA and it works perfectly...changing that metric to 0 also is nice....i upgraded these templates with my current accuweather graphs since most of them had stopped working.

Thanks

Post Reply