AccuWeather script & templates

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

Moderators: Developers, Moderators

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

Post by zoltar »

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:

Post by sumsum »

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

Post by wvr120364 »

@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

Post by thogan »

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

Post by Instigater »

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 1054 times
cacti_host_template_weather_server.xml.gz
(4.48 KiB) Downloaded 1102 times
accuweather.jpg
accuweather.jpg (66.8 KiB) Viewed 14887 times
User avatar
morgentau
Posts: 43
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

I get an error

Post by morgentau »

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

Post by Instigater »

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: 43
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

Post by morgentau »

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

Post by Instigater »

Your PHP settings in php.ini doesn't allow to open files on remote servers.
User avatar
morgentau
Posts: 43
Joined: Fri Jun 16, 2006 4:05 am
Location: Zurich, Switzerland

How can i change this?

Post by morgentau »

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

Post by JJX »

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:

Post by romanmir »

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: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

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...

Post by romanmir »

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: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

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

Who is online

Users browsing this forum: No registered users and 0 guests