WXforum.net
Web Weather => Weather Web Site Help => Topic started by: rlmarcum22 on July 09, 2021, 11:36:32 AM
-
I am trying to setup TweetWX with a cron job. I got the forecast one running but it looks like this: NWS fcst: TodayMstly Sunny : , Hi 84�F; TonightPtly Cloudy then Slight Chc Shwrs And T-Storms : , Lo 65�F; SatShwrs And T-Storms : , Hi 82�F; #weather http://ekyrrgweather.com. How can I fix this? Also I can't seem to get the current conditions tweets running. Thanks in advance! :?: :?:
-
This looks like a character set mismatch. You might try changing TweetWX-forecast.php
$t = preg_replace('| °|is','°',$t);
to $t = preg_replace('| °|is','',$t);
to just remove the degree sign altogether.
As for the current conditions tweets, what does the error message say?
Also, you have in Settings.php $SITE['WDdateMDY'] = true; // for WD date format of month/day/year. =false for day/month/year
but your testtags.php is showing dates like $date = '09/07/2021';
which is in D/M/Y format.
Change Settings.php to have $SITE['WDdateMDY'] = false; // for WD date format of month/day/year. =false for day/month/year
to have the dates display correctly.
-
I'm not getting any error message at all. Its not being carried out for some reason.
-
Check the error_log for the website .. you may have a fatal error in the script due to a syntax error. The only things you should have customized in the TweetWX-conditions.php script were for the
// --------------- settings ----------------------
$tweetWXdir = './';
$wxdir = '../'; // path to the advforecast2.php
$tweetTags = '#weather'; // customize for your Twitter tags and/or website url (shortened)
// ----------- end settings ----------------------
and $access_token = '-replace-with-token-from-TweetWX-setup2-'; // oauth_token
$access_token_secret = '-replace-with-token_secret-from-TweetWX-setup2-'; // oauth_token_secret
If you installed TweetWX-conditions.php in your document root, then $wxdir = './'; // path to the advforecast2.php
should be used.
-
How exactly do I check the error log? lol
-
If you have a cPanel control for your site, there's likely a 'Error Log' listing button on it.
Since you appear to have installed both TweetWX-conditions.php and TweetWX-forecast.php in your document root, I suspect it's the $wxdir setting that's causing the issue (fatal error including testtags.php).
-
So what do I do? The only error log I found was latest web server error log messages.
](*,)
-
I just got an error message that said "could not open input file"
-
How can I check to see if my Cron Jobs are being carried out? I am using HostGator and its not even tweeting my forecast as often as I have it set to.
-
I just ran your TweetWX-forecast.php manually, and it worked
East-Central Ky Weather @EastCentralKyWx· 1m
NWS fcst: TonightMstly Cloudy then Patchy Fog : , Lo 63F; SatPatchy Fog then Shwrs And T-Storms Likely : , Hi 83F ↓; SatNightShwrs And T-Storms Likely : , Lo 67F; #weather #kywx #ekywx http://ekyrrgweather.com
If your 'could not open input file' was for testtags.php, then do the change to $wxdir change I highlighted in a post above.
As for running / checking a cron job, what is the cron command you used? If it executes a script, what is the script you used?
Your forecast will tweet as often as the forecast changes (likely 4 times a day). Twitter will not tweet duplicate messages (forecast unchanged since last time).
-
Would I need to put /public_html/testtags.php?