views:

125

answers:

1

i'm using service link module and tries to add twitter link as below

if (variable_get('service_links_show_twitter', 0)) {
$turl = drupal_http_request('http://tinyurl.com/api-create.php?url='. $url);
$turl = isset($turl->data) ? $turl->data : urldecode($url) ;

$links['service_links_twitter'] = theme('service_links_build_link', t('Twitter'), "http://www.twitter.com/home/?status=$turl". "+".$title, t('Share on Twitter.'), 'images/twitter.png', $nodelink);

}

but the resulted tweet as below .

 http%3A%2F%2Ftestsite%2Fbabycare%2Ffeeding%2Fmy-art-title.

whats wrong with the above code and how generating valid output like

my article title - mysite_url: http://bit.ly/68Vg1O

+1  A: 

Are you sure it gets a properl url from TinyURL? Can you add a print $turl; before $links['service_links_twitter']..? and see what it gives you?

zerolab

related questions