AccuWeather script & templates
Moderators: Developers, Moderators
AccuWeather Graphing Problems
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?
- Instigater
- Cacti User
- Posts: 141
- Joined: Mon Dec 13, 2004 5:14 pm
- Location: Jurmala, Latvia
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!
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 (66.8 KiB) Viewed 14887 times
I get an error
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?
<?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?
- Instigater
- Cacti User
- Posts: 141
- Joined: Mon Dec 13, 2004 5:14 pm
- Location: Jurmala, Latvia
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
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:
in this line i see this:
What can i do to get the graphs working?
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
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");
}
- Instigater
- Cacti User
- Posts: 141
- Joined: Mon Dec 13, 2004 5:14 pm
- Location: Jurmala, Latvia
How can i change this?
Back from a long break i would like to make this weather graphs work.
How can i change the php.ini settings?
How can i change the php.ini settings?
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??
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??
Hmmm...
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.
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.
Who is online
Users browsing this forum: No registered users and 0 guests