WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: mkutche on August 19, 2017, 06:07:16 PM
-
When i goto execute TweetWX-forecast.php it says it's unable to write to anything but i made sure the chmod permissions were either 775 or 777 any ideas why? Maybe I need a version update but I checked and couldn't find one.
TweetWX-forecast.php - V2.00 - 17-Jul-2015
<!-- advforecast2.php (JSON) - V5.02 - 22-May-2017 on PHP 5.4.45-0+deb7u9-->
<!-- RAW NWS URL: http://forecast.weather.gov/MapClick.php?lat=39.3653&lon=-86.6586&unit=0&lg=english&FcstType=text&TextType=2 -->
<!-- zone=INZ053 -->
<!-- corrected NWS API URL='https://api.weather.gov/points/39.3653,-86.6586/forecast' -->
<!-- curl fetching 'https://api.weather.gov/points/39.3653,-86.6586/forecast' -->
<!-- HTTP stats: RC=200 dest=104.106.30.106 port=443 (from sce=192.168.1.134)
Times: dns=0.036 conn=0.058 pxfer=0.169 get=0.031 total=0.200 secs -->
<!-- loaded https://api.weather.gov/points/39.3653,-86.6586/forecast - 10322 bytes -->
<!-- unable to write cache file ./cache/forecast-INZ053-0-json.txt -->
<!-- meta info re: point='39.3653,-86.6586' zone='INZ053' metacache= './cache/forecast-INZ053-0-json-meta.txt' -->
<!-- metaZoneURL='https://api.weather.gov/zones/forecast/INZ053' -->
<!-- Meta cache file not found .. reloading data from NWS site -->
<!-- getting metadata for point from https://api.weather.gov/points/39.3653,-86.6586 -->
<!-- curl fetching 'https://api.weather.gov/points/39.3653,-86.6586' -->
<!-- HTTP stats: RC=200 dest=104.106.30.106 port=443 (from sce=192.168.1.134)
Times: dns=0.000 conn=0.020 pxfer=0.148 get=0.250 total=0.398 secs -->
<!-- distance=1 from Gosport -->
<!-- getting metadata for forecast zone from https://api.weather.gov/zones/forecast/INZ053 -->
<!-- curl fetching 'https://api.weather.gov/zones/forecast/INZ053' -->
<!-- HTTP stats: RC=200 dest=104.106.30.106 port=443 (from sce=192.168.1.134)
Times: dns=0.000 conn=0.022 pxfer=0.115 get=0.027 total=0.142 secs -->
<!-- getting metadata for forecast office from https://api.weather.gov/offices/IND -->
<!-- curl fetching 'https://api.weather.gov/offices/IND' -->
<!-- HTTP stats: RC=200 dest=104.106.30.106 port=443 (from sce=192.168.1.134)
Times: dns=0.000 conn=0.023 pxfer=0.117 get=0.657 total=0.775 secs -->
<!-- unable to write meta cache file ./cache/forecast-INZ053-0-json-meta.txt -->
<!-- META
Array
(
[city] => Gosport
[state] => IN
[point] => 39.3653,-86.6586
[forecastOfficeURL] => https://api.weather.gov/offices/IND
[forecastZoneURL] => https://api.weather.gov/zones/forecast/INZ053
[forecastZone] => INZ053
[forecastHourlyURL] => https://api.weather.gov/points/39.3653,-86.6586/forecast/hourly
[forecastGridDataURL] => https://api.weather.gov/gridpoints/IND/41,49
[observationStationsURL] => https://api.weather.gov/points/39.3653,-86.6586/stations
[countyZoneURL] => https://api.weather.gov/zones/county/INC119
[countyZone] => INC119
[fireWeatherZoneURL] => https://api.weather.gov/zones/fire/INZ053
[fireWeatherZone] => INZ053
[timeZone] => America/Indiana/Indianapolis
[radarStation] => KIND
[zoneName] => Owen
[WFOname] => Indianapolis, IN
)
-->
<!-- point forecast processing -->
<!-- missing icon './forecast/images/hi_ntsra20.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/fg.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/nsct.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/sct.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/hi_ntsra20.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/tsra60.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/nscttsra60.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/few.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/nfew.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/few.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/nfew.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/few.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/nfew.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- missing icon './forecast/images/few.jpg' .. using './forecast/images/na.jpg' instead -->
<!-- forecast updated '2017-08-19T21:15:41+00:00' (Sat, 19-Aug-2017 5:15pm EDT) for lat,long or zone 'POINT (-86.6586 39.3653)' -->
<!-- curl fetching 'https://api.weather.gov/alerts?active=1&zone=INZ053' -->
<!-- HTTP stats: RC=200 dest=104.106.30.106 port=443 (from sce=192.168.1.134)
Times: dns=0.000 conn=0.023 pxfer=0.119 get=0.272 total=0.391 secs -->
<!-- loaded alert for INZ053 from https://api.weather.gov/alerts?active=1&zone=INZ053 - 624 bytes -->
<!-- unable to write cache file ./cache/forecast-INZ053-0-json-alerts.txt -->
<!-- ALERTJSON
Array
(
[@context] =>
[@graph] => Array
(
)
[title] => Current watches, warnings, and advisories for Owen (INZ053) IN
)
-->
<!-- preparing 0 warning links -->
<!-- now Sat, 19-Aug-2017 6:04pm EDT (Sat, 19-Aug-2017 10:04pm GMT) -->
advforecast2.php (JSON) - V5.02 - 22-May-2017
NWS Fcst: Tonight: Isolated Showers And T-Storms then Patchy Fog , Lo 63F ↑; Sunday: Patchy Fog then Mostly Sunny , Hi 88F; Sunday Night: Partly Cloudy , Lo 68F ↑; goo.gl/N5AHJe #INwx
Message is too long (195 bytes) -- reducing size.
NWS Fcst: Tonight: Isol Shwrs+Tstrm->Ptchy Fog , Lo 63F ↑; Sun: Ptchy Fog->Mstly Sunny , Hi 88F; Sun Night: Ptly Cldy , Lo 68F ↑; goo.gl/N5AHJe #INwx
len=159 bytes.
Message still too long (159 bytes). Formatting 3 tweets instead
UTF='NWS Fcst(1/3): Tonight: Isolated Showers And T-Storms then Patchy Fog , Lo 63F ↑; goo.gl/N5AHJe #INwx' len=106 bytes.
status={
"created_at": "Sat Aug 19 22:04:49 +0000 2017",
"id": 899029412024381440,
"id_str": "899029412024381440",
"text": "NWS Fcst(1\/3): Tonight: Isolated Showers And T-Storms then Patchy Fog , Lo 63F &uarr;; https:\/\/t.co\/h0WttYuizO #INwx",
"truncated": false,
"entities": {
"hashtags": [
{
"text": "INwx",
"indices": [
115,
120
]
}
],
"symbols": [
],
"user_mentions": [
],
"urls": [
{
"url": "https:\/\/t.co\/h0WttYuizO",
"expanded_url": "http:\/\/goo.gl\/N5AHJe",
"display_url": "goo.gl\/N5AHJe",
"indices": [
91,
114
]
}
]
},
"source": "\u003ca href=\"http:\/\/saratoga-weather.org\/scripts-TweetWX.php#TweetWX\" rel=\"nofollow\"\u003eTweetWX\u003c\/a\u003e",
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 1522989468,
"id_str": "1522989468",
"name": "GosportINWX",
"screen_name": "GosportINWX",
"location": "Gosport, IN, USA",
"description": "Gosport, IN's ONLY live weather reported by a personal weather station. Providing WXAlerts, HDSkyCam, and other useful weather information!",
"url": "https:\/\/t.co\/67tqSYQIzW",
"entities": {
"url": {
"urls": [
{
"url": "https:\/\/t.co\/67tqSYQIzW",
"expanded_url": "http:\/\/www.gosportwx.com",
"display_url": "gosportwx.com",
"indices": [
0,
23
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 276,
"friends_count": 323,
"listed_count": 24,
"created_at": "Sun Jun 16 19:32:20 +0000 2013",
"favourites_count": 440,
"utc_offset": -14400,
"time_zone": "Eastern Time (US & Canada)",
"geo_enabled": true,
"verified": false,
"statuses_count": 49733,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "EBEBEB",
"profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif",
"profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif",
"profile_background_tile": false,
"profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/541747625435729920\/sN8YIuu5_normal.png",
"profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/541747625435729920\/sN8YIuu5_normal.png",
"profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/1522989468\/1466304361",
"profile_link_color": "23667A",
"profile_sidebar_border_color": "FFFFFF",
"profile_sidebar_fill_color": "F3F3F3",
"profile_text_color": "333333",
"profile_use_background_image": false,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": false,
"follow_request_sent": false,
"notifications": false,
"translator_type": "none"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"lang": "en"
}
UTF='NWS Fcst(2/3): Sunday: Patchy Fog then Mostly Sunny , Hi 88F; goo.gl/N5AHJe #INwx' len=81 bytes.
status={
"created_at": "Sat Aug 19 22:04:52 +0000 2017",
"id": 899029422455631873,
"id_str": "899029422455631873",
"text": "NWS Fcst(2\/3): Sunday: Patchy Fog then Mostly Sunny , Hi 88F; https:\/\/t.co\/h0WttYuizO #INwx",
"truncated": false,
"entities": {
"hashtags": [
{
"text": "INwx",
"indices": [
86,
91
]
}
],
"symbols": [
],
"user_mentions": [
],
"urls": [
{
"url": "https:\/\/t.co\/h0WttYuizO",
"expanded_url": "http:\/\/goo.gl\/N5AHJe",
"display_url": "goo.gl\/N5AHJe",
"indices": [
62,
85
]
}
]
},
"source": "\u003ca href=\"http:\/\/saratoga-weather.org\/scripts-TweetWX.php#TweetWX\" rel=\"nofollow\"\u003eTweetWX\u003c\/a\u003e",
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 1522989468,
"id_str": "1522989468",
"name": "GosportINWX",
"screen_name": "GosportINWX",
"location": "Gosport, IN, USA",
"description": "Gosport, IN's ONLY live weather reported by a personal weather station. Providing WXAlerts, HDSkyCam, and other useful weather information!",
"url": "https:\/\/t.co\/67tqSYQIzW",
"entities": {
"url": {
"urls": [
{
"url": "https:\/\/t.co\/67tqSYQIzW",
"expanded_url": "http:\/\/www.gosportwx.com",
"display_url": "gosportwx.com",
"indices": [
0,
23
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 276,
"friends_count": 323,
"listed_count": 24,
"created_at": "Sun Jun 16 19:32:20 +0000 2013",
"favourites_count": 440,
"utc_offset": -14400,
"time_zone": "Eastern Time (US & Canada)",
"geo_enabled": true,
"verified": false,
"statuses_count": 49734,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "EBEBEB",
"profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif",
"profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif",
"profile_background_tile": false,
"profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/541747625435729920\/sN8YIuu5_normal.png",
"profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/541747625435729920\/sN8YIuu5_normal.png",
"profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/1522989468\/1466304361",
"profile_link_color": "23667A",
"profile_sidebar_border_color": "FFFFFF",
"profile_sidebar_fill_color": "F3F3F3",
"profile_text_color": "333333",
"profile_use_background_image": false,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": false,
"follow_request_sent": false,
"notifications": false,
"translator_type": "none"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"lang": "en"
}
UTF='NWS Fcst(3/3): Sunday Night: Partly Cloudy , Lo 68F ↑; goo.gl/N5AHJe #INwx' len=79 bytes.
status={
"created_at": "Sat Aug 19 22:04:54 +0000 2017",
"id": 899029432672948228,
"id_str": "899029432672948228",
"text": "NWS Fcst(3\/3): Sunday Night: Partly Cloudy , Lo 68F &uarr;; https:\/\/t.co\/h0WttYuizO #INwx",
"truncated": false,
"entities": {
"hashtags": [
{
"text": "INwx",
"indices": [
88,
93
]
}
],
"symbols": [
],
"user_mentions": [
],
"urls": [
{
"url": "https:\/\/t.co\/h0WttYuizO",
"expanded_url": "http:\/\/goo.gl\/N5AHJe",
"display_url": "goo.gl\/N5AHJe",
"indices": [
64,
87
]
}
]
},
"source": "\u003ca href=\"http:\/\/saratoga-weather.org\/scripts-TweetWX.php#TweetWX\" rel=\"nofollow\"\u003eTweetWX\u003c\/a\u003e",
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 1522989468,
"id_str": "1522989468",
"name": "GosportINWX",
"screen_name": "GosportINWX",
"location": "Gosport, IN, USA",
"description": "Gosport, IN's ONLY live weather reported by a personal weather station. Providing WXAlerts, HDSkyCam, and other useful weather information!",
"url": "https:\/\/t.co\/67tqSYQIzW",
"entities": {
"url": {
"urls": [
{
"url": "https:\/\/t.co\/67tqSYQIzW",
"expanded_url": "http:\/\/www.gosportwx.com",
"display_url": "gosportwx.com",
"indices": [
0,
23
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 276,
"friends_count": 323,
"listed_count": 24,
"created_at": "Sun Jun 16 19:32:20 +0000 2013",
"favourites_count": 440,
"utc_offset": -14400,
"time_zone": "Eastern Time (US & Canada)",
"geo_enabled": true,
"verified": false,
"statuses_count": 49735,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"is_translation_enabled": false,
"profile_background_color": "EBEBEB",
"profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif",
"profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif",
"profile_background_tile": false,
"profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/541747625435729920\/sN8YIuu5_normal.png",
"profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/541747625435729920\/sN8YIuu5_normal.png",
"profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/1522989468\/1466304361",
"profile_link_color": "23667A",
"profile_sidebar_border_color": "FFFFFF",
"profile_sidebar_fill_color": "F3F3F3",
"profile_text_color": "333333",
"profile_use_background_image": false,
"has_extended_profile": false,
"default_profile": false,
"default_profile_image": false,
"following": false,
"follow_request_sent": false,
"notifications": false,
"translator_type": "none"
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"is_quote_status": false,
"retweet_count": 0,
"favorite_count": 0,
"favorited": false,
"retweeted": false,
"possibly_sensitive": false,
"lang": "en"
}
-
If you're running TweetWX-forecast.php in a subdirectory, then that subdirectory will need a ./cache/ directory too.
-
If you're running TweetWX-forecast.php in a subdirectory, then that subdirectory will need a ./cache/ directory too.
That is weird because it's worked before by just using my ./cache/ file outside the subdirectory. That fixed the problem though thanks :)
Mike
-
I forget how do I check the versions on my files again?
Mike
-
For the template core files, it's check-fetch-times.php?show=versions
If you have the Regional network mesonet-map set, then mesonet-map-check-versions.php does that.
For other scripts, you'll have to check the source page for the script (on the site where you downloaded the script)
-
For the template core files, it's check-fetch-times.php?show=versions
If you have the Regional network mesonet-map set, then mesonet-map-check-versions.php does that.
For other scripts, you'll have to check the source page for the script (on the site where you downloaded the script)
Thanks! :)
-
Hey Ken with that TweetWX/TweetWX-forecast.php why does this line "text": "NWS Fcst(1\/3): This Afternoon: Mostly Sunny , Hi 91F &darr;; https:\/\/t.co\/h0WttYuizO #INwx", have a "&darr"
-
When the point forecast is not available, the advforecast2.php script parses the text-only zone forecast which has a temperature range in it. That is represented by the approximately equal sign. That is the ↓ HTML entity used.
Just means a zone forecast with approximate temperatures are displayed.
-
When the point forecast is not available, the advforecast2.php script parses the text-only zone forecast which has a temperature range in it. That is represented by the approximately equal sign. That is the ↓ HTML entity used.
Just means a zone forecast with approximate temperatures are displayed.
Ok thanks :)