monkeyI just finished installing the latest version of the Tweet This WordPress Plugin. It renders my Tweet This Hack obsolete. As now you can configure the text that comes out. This is as it should be. I’m so honored! Richard Thripp, the author of Tweet This, even dropped by and made a comment on that post. Since my version is standard again, I feel another hack coming on. However I still have not sensed even one monkey trying to escape from my personal solid waste disposal port yet.


The new Tweet This allows you to choose from a number of link shrinkers if the old one didn’t already. But Adjix isn’t one of the supported options, I think adjix should be one of the link shrinkers you can choose, especially since I have this awesome adjix interface class that I wrote just laying around rotting. Oh yeah, and you can get filthy rich from it too. I’m counting on that happening whenever the monkeys show up.

In order to support adjix, we’ll need to be able to choose adjix from the configuration menu, and handle it when it is chosen. Looks like it also wants to be told the URL length for each specific shortener.

I handled the URL length in get_tweet_this_trim_title line 110. This line goes right before “else $url_len = ‘20′. It sets the URL length for adjix:

 elseif (get_option('tt_url_service') == 'adjix') $url_len = '22';

At line 411 I added the adjix option to the options, like this:

<option value='adjix' <?php if (get_option('tt_urlservice') == 'adjix') echo ' selected="selected"'; ?>> Adjix.com (22 Characters)</option>

And now that I can configure it, I need to write code to use it if it is selected, so in the get_tweet_this_short_url routine I added a clause for adjix, and it looks like this:

                elseif (get_option('tt_url_service') == 'adjix') {
                        require_once('adjix.php');
                        $adjix = new Adjix('/////////////','http://pr.tixr.us');
                        try {
                            $url = $adjix->makeLink($purl,ADJX_Entertainment);
                        } catch (Exception $e) {
                            echo "caught exception ", $e->getMessage() , "\n";
                        }
                }

////// is my adjix registered email address. No way am I exposing that to spammers. In order to make it all work, of course I had to dump the little adjix class from the shrinkage post into the tweet-this folder, and I have to say that my adjix class is PHP5 only.

Let’s test it, shall we? Hmmm… it worked on this post in preview mode. Might as well go ahead and publish. It’s my personal hack anyway. Use at your own risk and all that.

Obviously I hard coded my email and my cloaking domain. Those would also be configurations if adjix were to be fully supported in a released version. That’s something for Richard to do if he ever wants to include adjix as a shortener. But meanwhile, the hack works for me. Hey, in two months I’ve made a whopping $0.60 off of adjix! At that rate I’ll be able to retire to…. oh gee, the options are so boundless: under the Van Buren bridge, or the homeless camp out north of town or other possibilities that might spring up in the meantime.

Listen to this post Listen to this post