WordPress & YOURLS, Error 417 – How to fix

When you tweet your new posts with wordpress into twitter and use the YOURLS-Plugin for it, then these fail telling you that twitter is down and you should retry later. However that is not the case, the problem is lying at another level in the protocol for posting the tweet.

You can fix that by editing in your wordpress-directory,

./wp-content/plugins/yourls-wordpress-to-twitter/inc/twitter.php

and add a line 9, so that it looks like:

    $host = "http://twitter.com/statuses/update.xml?status=".urlencode(stripslashes(urldecode($message)));

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_HTTPHEADER,array("Expect:"));
    curl_setopt($ch, CURLOPT_URL, $host);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);

Then these tweets work again.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>