8月 232010
 

これでうまく行くといいのだが。。。

うまくいったので追加で更新。

WordTwitはbit.lyのURLの処理にデフォルトでURLエンコードをしているらしい。

wp-content/plugins/wordtwit/wordtwit.phpの607行目あたり。

$result = twit_hit_server( 'http://api.bit.ly/shorten?version=2.0.1&longUrl=' . urlencode( $link ) . '&format=xml&history=1&login=' . $settings['bitly-user-name'] . '&apiKey=' . $settings['bitly-api-key'], '', '', $output );

このurlencodeを外して、

$result = twit_hit_server( 'http://api.bit.ly/shorten?version=2.0.1&longUrl=' . $link . '&format=xml&history=1&login=' . $settings['bitly-user-name'] . '&apiKey=' . $settings['bitly-api-key'], '', '', $output );
//$result = twit_hit_server( 'http://api.bit.ly/shorten?version=2.0.1&longUrl=' . urlencode( $link ) . '&format=xml&history=1&login=' . $settings['bitly-user-name'] . '&apiKey=' . $settings['bitly-api-key'], '', '', $output );

という感じにする。

そうそう、これはパーマリンクに日本語を使っているときの対処法ね。

あきらめて日本語パーマリンクにすることにしたのでURLエンコードされてしまうと全く別のURLと解釈されてしまうので、Bit.lyで別の短縮URLになってしまうらしい。

というわけで、めでたくWP Twitter Buttonのカウントも正しくできたってわけです。

ツイートツイート

Related posts:

  1. プラグインを改造してみた。
  2. WordTwitウィジェットのHTMLを変更
  3. タグの重複問題のその後
  4. エントリーのURL
  5. 今使っているプラグインメモ

  One Response to “WordTwitを少しかえてみた”

  1. できとらん、できとらんぞぉぉぉぉぉぉぉぉぉ!

 Leave a Reply

(required)

(required)

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>