WxSim Temperature Forecast Comparison Script

Yes there sure are, at least we have all the path errors fixed now. I’m not sure what could be causing the errors that we have now. Do you know what version PHP you’re running?

Not a cause of these errors, but you have an extra blank line in your PM log that you can remove using notepad or similar. Meanwhile I need to do some thinking.

  • Jim

Added: Let’s try the attached where I have error reporting turned off. Some newer versions of PHP throw notices etc. that didn’t exist when this code was written.


test-fc.php.txt (2 KB)

that seems to work.

thnak you

You’re very welcome, sorry it took so long. - Jim

I have just one more question.
Where do I change “NW” in the tables to “EC”?

ooops found more errors.

When I try to manually run the cron jobs, I get a ton of errors again

Duh, I should have realized that the error reporting should have been placed in the forecast-compare-include.php file. :oops: Please try the attached which has that now. I did a test on your EV log so you’ll want to clear that out.

Changing any of the text such as “EC” in the display code can be done in the fc-language.php file.

  • Jim

forecast-compare-include.php.txt (45 KB)

Something very weird going on…
I can manually enter the cron in the browser and everything works perfectly.
If I enter this “https://weatheryyc.com/alt/forecast-compare-include.php?log$config=XX” nothing happens
I have tried 2 different crontabs, windows scheduler, and an online cron service with all the same results.

Any ideas?

Thanks
Blaine

Blaine,

It looks like you have a typo in that URL

?log$config=XX

should use an ampersand like this

?log&config=XX

Let’s see how that works.

  • Jim

Added: If that doesn’t do it, take a look at https://stackoverflow.com/questions/8662024/how-do-i-capture-the-output-of-a-script-if-it-is-being-ran-by-the-task-scheduler for some ideas on how to capture any errors that are output.

Something still doesn’t look right. Most of the ACT temps are the same.

https://weatheryyc.com/alt/forecast-compare.php

The first thing that comes to mind is that if you tried using Fc-Log-Temps.php and gave up, then you need to remove the fc-temps.txt file that it created otherwise it’ll override the figures in testtags. Otherwise, it has to be a problem with your cron?

I won’t have time today to look closer, but will look later. Let me know how you’re doing.

  • Jim

I have deleted fc-temp.txt. I will see how it goes later today

numbers seem to be better now.

Thank you

Outstanding! :smiley:

Hi, all and especially Jim!

I already plowed thru this post for days now and i have made considerable progress, but still one fault keeps bugging me. It keeps saying that it can’t find the yrfcst.php but it is present. When i run that script i am getting this:

1600410957 < && 1600410957 > Is night? 1
. But when i run testfc i get what you can see in the attach:

Now my question is as follows: Can someone point me in the right direction? I know it has to be something stupid, but i can’t get my head around it! #-o

Marc AKA Staccermaccer,

https://www.akker.be/wxcompare.php


Marc,

Your problem is in yrfrcst.php, that is where the output that you are seeing is coming from. I’ve attached a fresh copy of that file, so run that just as it is and see if you get the same output that I get which I’ve also attached.

Henkka wrote yrfrcst.php many years ago and there has never been a reason to change it. I suspect it is having trouble getting the yrno forecast for your location?

  • Jim

yrfrcst.php.txt (17.4 KB)

MyOutput.txt (489 Bytes)

Hi, Jim!

Thanks for the folluw-up, tried your copy but to no avail…

1600433687 < 1600440600 && 1600433687 > 1600397400 Is night? Unable to obtain the temperature variables from /customers/b/c/b/akker.be/httpd.www/yrfrcst.php, check the installation of that script.

I know for a fact that it is in place, so why is it giving this message?

Marc,

Marc,

I’ve been looking at this further and it appears that the comparison script no longer supports yrno forecasts. It’s hell to get old and I don’t recall how that came about. I’ll poke around later today and see what I can figure out.

What is the url to your yrno forecast?

  • Jim

Jim,

No problem i will pick another forecast, just did that and changed it to the WU via the WC-forecast script and guess what: That works!! But the forecast-compare-include script gives a lot of ‘undefined offset’ errors.

Any idea how to fix that??

1600438768 < 1600440600 && 1600438768 > 1600397400 Is night? 22828 02718 02715 02618 02318 02217 02118 01917 02014 018 Array ( [0] => 28 [1] => 28 [2] => 27 [3] => 18 [4] => 27 [5] => 15 [6] => 26 [7] => 18 [8] => 23 [9] => 18 [10] => 22 [11] => 17 [12] => 21 [13] => 18 [14] => 19 [15] => 17 [16] => 20 [17] => 14 [18] => 18 [19] => ) Notice: Undefined offset: 0 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 247 Notice: Undefined offset: 0 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 267 Notice: Undefined offset: 1 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 267 Notice: Undefined offset: 2 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 267 Notice: Undefined offset: 3 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 267 Notice: Undefined offset: 4 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 267 Notice: Undefined offset: 5 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 316 Notice: Undefined offset: 6 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 316 Notice: Undefined offset: 7 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 316 Notice: Undefined offset: 8 in /customers/b/c/b/akker.be/httpd.www/forecast-compare-include.php on line 316 Notice: Undefined offset: 9 in

I can work these errors away by putting an ampersand before the lines, but will the script then still be functional?

https://www.akker.be/wxcompare.php

Marc,

Greetings Jim

I continue to work with your magnificent script on a friend’s website.

He is using the comparisons with the following forecasts:

http://badameteo.com/plaintext-parser.php

ttp://badameteo.com/WC-forecast.php

The script correctly detects the maximum and minimum temperature values ​​using the Weatherdisplay file “testtags.txt”:

http://badameteo.com/testtags.php?sce=view

http://badameteo.com/fctest.php

http://badameteo.com/fc-config.php?sce=view

Everything works fine except …

By running http://badameteo.com/forecast-compare-include.php?log&config=XX

The “forecastXX.log” files are not updated and the following error occurs:

Error: You must manually upload an empty text file named /home/badameteo/www/ and give it write permissions (CHMOD 666).

For now we are dedicated to updating the “forecastXX.log” files manually:

                                [http://badameteo.com/fc-full.php](http://badameteo.com/fc-full.php)

I cannot understand the origin of this anomaly.

Surely your opinion can be very clarifying.

I thank you very much for all your work and your dedication.

Greetings from Spain

Kocher,

It sure seems like the problem is writing to that file. If you have permissions set 666 on the log files you could try 777.

When I try to view a log with http://badameteo.com/forecastAM.log I get a 403 error, “Forbidden You don’t have permission to access this resource” so maybe that’s a clue. Perhaps your server has something against “.log” files? If that’s the case you could try renaming them all .txt and then make that change in fc-config.php.

Please let me know what you learn.

  • Jim