Got to love the Twitter developers .. they turned off the API V1.0 on 11-June-2013 and forced everyone to use the API V1.1 instead.
Sigh.. I've done an update to TweetWX-globals.php that should fix your issues (no customization needed). The changes are to use HTTPS/SSL instead of HTTP for posting the status (and a new destination URL).
Let me know how it works for you
Best regards,
Ken
Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended - particularly for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended - particularly for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
TweetWX script updated for Twitter API V1.1
Moderator: saratogaWX
- saratogaWX
- Posts: 1211
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
TweetWX script updated for Twitter API V1.1
You do not have the required permissions to view the files attached to this post.
- saratogaWX
- Posts: 1211
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Re: TweetWX script updated for Twitter API V1.1
For those who would prefer to update their code in-place, the following changes were made to TweetWX-global.php (also applies to Mike's TweetWX642-global.php script):
Change:
To:
Change:
To:
Change:
To:
And your feed should work again.
Best regards,
Ken
Change:
Code: Select all
function do_post($url, $postbody, $port=80, $headers=NULL)
{
$retarr = array(); // Return value
$curl_opts = array(CURLOPT_URL => $url,
CURLOPT_PORT => $port,
CURLOPT_POST => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_POSTFIELDS => $postbody,
CURLOPT_RETURNTRANSFER => true);
Code: Select all
function do_post($url, $postbody, $port=443, $headers=NULL)
{
$retarr = array(); // Return value
$curl_opts = array(CURLOPT_URL => $url,
CURLOPT_PORT => $port,
CURLOPT_POST => true,
CURLOPT_SSL_VERIFYHOST => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_POSTFIELDS => $postbody,
CURLOPT_RETURNTRANSFER => true);
Code: Select all
$url = 'http://api.twitter.com/1/statuses/update.json';
Code: Select all
$url = 'https://api.twitter.com/1.1/statuses/update.json';
Code: Select all
if ($usePost) {
$request_url = $url;
logit("tweet:INFO:request_url:$request_url");
logit("tweet:INFO:post_body:$query_parameter_string");
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
$response = do_post($request_url, $query_parameter_string, 80, $headers);
} else {
Code: Select all
if ($usePost) {
$request_url = $url;
logit("tweet:INFO:request_url:$request_url");
logit("tweet:INFO:post_body:$query_parameter_string");
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
$response = do_post($request_url, $query_parameter_string, 443, $headers);
} else {
Best regards,
Ken
-
- Posts: 19
- Joined: Thu 04 Jul 2013 4:13 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 7
- Location: Ciudad Guayana, Venezuela
Re: TweetWX script updated for Twitter API V1.1
This php works for the templates with cumulus data?
- saratogaWX
- Posts: 1211
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Re: TweetWX script updated for Twitter API V1.1
At present, the TweetWX PHP scripts (for conditions and forecast) work only with Weather-Display for conditions and with the USA NOAA forecasts for the forecast tweets. I'm working on generalizing the scripts to work with any software supported by the template set and forecasts from Environment Canada and WeatherUnderground, but the scripts are not yet finished.
Best regards,
Ken
Best regards,
Ken
-
- Posts: 19
- Joined: Thu 04 Jul 2013 4:13 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows 7
- Location: Ciudad Guayana, Venezuela
Re: TweetWX script updated for Twitter API V1.1
thank you very much Ken, I look forward for that script
- saratogaWX
- Posts: 1211
- Joined: Wed 06 May 2009 5:02 am
- Weather Station: Davis Vantage Pro Plus
- Operating System: Windows 10 Professional
- Location: Saratoga, CA, USA
- Contact:
Re: TweetWX script updated for Twitter API V1.1
TweetWX scripts no longer function after 12:00 13-Jun-2023 Pacific. Twitter has suspended the application ID for TweetWX for 'rules violations' (likely over 1500 tweets per month with all the instances sharing the same app ID).
Sigh.. I've now deprecated the scripts and suggest you take them off your cron executions.
Sigh.. I've now deprecated the scripts and suggest you take them off your cron executions.
- ConligWX
- Posts: 1681
- Joined: Mon 19 May 2014 10:45 pm
- Weather Station: Davis vPro2+ w/DFARS + AirLink
- Operating System: Ubuntu 24.04 LTS
- Location: Bangor, NI
- Contact:
Re: TweetWX script updated for Twitter API V1.1
I'm also surprised that the Twitter module in my Meteobridge Nano is still working!!
Regards Simon
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0
https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir • CumulusMX v4.0.0