Home > Code Snippets > Just activated bz2url with WP to Twitter

Just activated bz2url with WP to Twitter

We just activated our url compressor WP to Twitter. Trying to enable the WP to Twitter to work with the bz2 compressor. In fact this is a test post for the same. The WP to Twitter is simply superb, thankyou Doleson.

First activated bz2url, and then wp-to-twitter, configured wp-to-twitter as the initial setup help provides. The twitter application keys and the rest is patched. Now went straight into the code for wp-to-twitter, in wp-to-twitter-manager.php, at line 470 added
<option value="9" <?php jd_checkSelect('jd_shortener','9'); ?>>
<?php _e("Use bz2.in plugin."'wp-to-twitter'); ?></option>

as a new line, and saved this. Then in wp-to-twitter.php, at line 493, added the following
                        case 9:
// bz2.in built in
$link urldecode($thispostlink);
$shrink shorten_pls($link);
break;

In the bz2url version 1.1, the shorten_pls does not exist, and it was added to the bottom of the plugin file.
function shorten_pls($url){
global 
$bz2;
$url str_replace(site_url(),'',$url);
return 
$bz2->compress($url);
}

Then revisited the WP to Twitter settings to choose our bz2url as the preffered compressor, and it rocks.

Categories: Code Snippets Tags:
  1. Rajivdh
    March 16th, 2012 at 16:51 | #1

    Alert!: Oracle has announced their marquee event JavaOne and Oracle Develop 2012 being held in Hyderabad on 3-4 May. Registrations have also started (Link: http://www.oracle.com/javaone/in-en/index.html?pcode=WWMK11024795MPP084&src=7268797&Act=155 ).

  1. No trackbacks yet.