mgsisk / webcomic

Comic publishing power for the web. Turn your WordPress-powered site into a comic publishing platform with Webcomic.
http://wordpress.org/plugins/webcomic
GNU General Public License v2.0
110 stars 29 forks source link

New Twitter API Update Breaks Webcomic Twitter support. #148

Closed Mihari closed 11 years ago

Mihari commented 11 years ago

Recived the following error when posting a comic today:

Twitter Error: {"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}

mgsisk commented 11 years ago

Thanks for the heads up; I'll see if I can find a fix today.

mgsisk commented 11 years ago

This should be a quick fix you can do yourself, if you'd like (I'm not sure when I'll be able to push an update to WordPress.org, unfortunately). There are four lines that invoke the Twitter API: 615, 1100, and 1105 in webcomic.php and 1574 in -/php/config.php. Three of them need to be changed so that the 1 part is 1.1, like:

// line 615 in webcomic.php
$code = $oauth->request( 'GET', $oauth->url( '1/account/verify_credentials' ) );

becomes:

// line 615 in webcomic.php
$code = $oauth->request( 'GET', $oauth->url( '1.1/account/verify_credentials' ) );

and this:

// line 1105 in webcomic.php
$code = $oauth->request( 'POST', $oauth->url( '1/statuses/update' ), array(

becomes:

// line 1105 in webcomic.php
$code = $oauth->request( 'POST', $oauth->url( '1.1/statuses/update' ), array(

and this:

// line 1574 in -/php/config.php
$code = $oauth->request( 'GET', $oauth->url( '1/account/verify_credentials' ) );

becomes:

// line 1574 in -/php/config.php
$code = $oauth->request( 'GET', $oauth->url( '1.1/account/verify_credentials' ) );

and that should correct the error.

mgsisk commented 11 years ago

Fixed in 6bd442ac1aca3740171c92da8cf32b8c9cd1720c