So instead of using cron to run the script (Bluehost made it to complicated and I don't want to upgrade to a VPS), I'm using a wscript on my windows computer to execute a powershell script (so that its silent, no powershell window) and using task scheduler to execute the script during the schedule I specified.
Here is that script for those interested:
Save As tweetforecast.ps1
Invoke-WebRequest http://websiteaddress/TweetWX/TweetWX-forecast.php
Save As forecast.js:
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run('%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -File "C:\\Scripts\\tweetforecast.ps1"', 0, false);
Now create a task in task scheduler that executes wscript and put the location of the forecast.js file in the argument section.
Anyways back to my issue:
I got this error this morning and I suspect it is because the forecast hasn't been updated, but I'd like it to go ahead and post anyways, any way to do that?
[title] => Current watches, warnings, and advisories for Coffee (TNZ077) TN
)
-->
<!-- preparing 1 warning links -->
<!-- now 10:19 am CDT Apr 19, 2018 (3:19 pm GMT Apr 19, 2018) -->
<!-- alert expires 12:00 pm CDT Apr 19, 2018 (2018-04-19T12:00:00-05:00) -->
<!-- URL cache saved to /home2/coffehf2/cache/forecast-URLcache.txt with 1 entries. -->
advforecast2.php (JSON) - V5.07 - 14-Apr-2018
NWS Fcst: Today: Mostly Sunny , Hi 56F; Tonight: Mostly Clear then Patchy Frost , Lo 35F; Friday: Patchy Frost then Sunny , Hi 68F; https://bit.ly/2JTyYqa #TNwx
len=162 bytes.
UTF='NWS Fcst: Today: Mostly Sunny , Hi 56F; Tonight: Mostly Clear then Patchy Frost , Lo 35F; Friday: Patchy Frost then Sunny , Hi 68F; https://bit.ly/2JTyYqa #TNwx' len=162 bytes.
status={
"errors": [
{
"code": 187,
"message": "Status is a duplicate."
}
]
}