Author Topic: Tweet WX  (Read 784 times)

0 Members and 1 Guest are viewing this topic.

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Tweet WX
« 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! :?: :?:

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Tweet WX
« Reply #1 on: July 09, 2021, 12:39:16 PM »
This looks like a character set mismatch.  You might try changing TweetWX-forecast.php
Code: [Select]
$t = preg_replace('| °|is','°',$t);
to
Code: [Select]
$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
Code: [Select]
$SITE['WDdateMDY'] = true; // for WD date format of month/day/year.  =false for day/month/year
but your testtags.php is showing dates like
Code: [Select]
$date = '09/07/2021';
which is in D/M/Y format.
Change Settings.php to have
Code: [Select]
$SITE['WDdateMDY'] = false; // for WD date format of month/day/year.  =false for day/month/year
to have the dates display correctly. 
« Last Edit: July 09, 2021, 12:45:25 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Re: Tweet WX
« Reply #2 on: July 09, 2021, 03:30:22 PM »
I'm not getting any error message at all.  Its not being carried out for some reason.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Tweet WX
« Reply #3 on: July 09, 2021, 07:00:54 PM »
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
Code: [Select]
// --------------- settings ----------------------
$tweetWXdir = './';
$wxdir = '../';  // path to the advforecast2.php
$tweetTags = '#weather';  // customize for your Twitter tags and/or website url (shortened)
// ----------- end settings ----------------------
and
Code: [Select]
$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
Code: [Select]
$wxdir = './';  // path to the advforecast2.php should be used.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Re: Tweet WX
« Reply #4 on: July 09, 2021, 07:13:28 PM »
How exactly do I check the error log? lol

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Tweet WX
« Reply #5 on: July 09, 2021, 07:32:09 PM »
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).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Re: Tweet WX
« Reply #6 on: July 09, 2021, 07:47:39 PM »
So what do I do?  The only error log I found was latest web server error log messages.
 ](*,)

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Re: Tweet WX
« Reply #7 on: July 09, 2021, 08:10:46 PM »
I just got an error message that said "could not open input file"

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Re: Tweet WX
« Reply #8 on: July 09, 2021, 08:52:20 PM »
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.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Tweet WX
« Reply #9 on: July 09, 2021, 09:09:37 PM »
I just ran your TweetWX-forecast.php manually, and it worked
Quote
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).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline rlmarcum22

  • Senior Member
  • **
  • Posts: 86
    • East-Central Kentucky Weather
Re: Tweet WX
« Reply #10 on: July 09, 2021, 09:18:53 PM »
Would I need to put /public_html/testtags.php?