• I am trying to hack the TwitThis code in sociable.php. I am starting with Sociable 3.0.6.

    I want to shrink the PermaLink using TinyURL and then pass a more reader-friendly message to Twitter.

    At about line 801, I found this code:

    $url = $site['url'];

    Immediately after this, I added this:

    if ($sitename == 'TwitThis') {
    $twitperma = file_get_contents('http://tinyurl.com/api-create.php?url='.$permalink);
    $url = str_replace('PERMALINK', $twitperma, $url);
    } else {
    $url = str_replace('PERMALINK', $permalink, $url);
    }

    Then I replace the TwitThis code at about line 561, to this:

    'TwitThis' => Array(
    	'favicon' => 'twitter.gif',
    	'url' => 'http://twitter.com/home?status=I just read “TITLE” by @MichaelHyatt: PERMALINK',
    	),

    This all works great, and you can see it in action here.

    However, if I specify in the Sociable Settings | Position page to use Sociable in my RSS feed, it breaks the feed, and it won’t validate or update.

    Does anyone have a suggestion for how I can fix this? I love this plugin!

The topic ‘Need help with TwitThis Hack in Sociable’ is closed to new replies.