Closed GoogleCodeExporter closed 8 years ago
or get the expand url like the code in the function twitter_url_shorten_callback
else if(preg_match('/http:\/\/bit\.ly\/([a-z0-9]{5}[a-z0-9]*)/i',$url,$match)) {
$url_id = $match[1];
$request =
'http://api.bit.ly/expand?version=2.0.1&hash='.$url_id.'&login='.BITLY_LOGIN.'&a
piKey='.BITLY_API_KEY;
$json = json_decode(twitter_fetch($request));
if ($json->errorCode == 0) {
$results = (array) $json->results;
$result = array_pop($results);
return "<a href='".$result->longUrl."' target='_blank' >".$url."</a>";
}
}
Original comment by LanG.asnama
on 13 Oct 2009 at 7:09
Hi there~
I found there is a long_url function commented out in common/twitter.php
Why not just enable this function by default, or provide an option to enable
this
feature?
Original comment by cnye...@gmail.com
on 16 Oct 2009 at 3:25
This is available since R234 http://code.google.com/p/dabr/source/detail?r=234
It is not enabled by default on dabr.co.uk because it does slow things down (a
little).
It will also produce some *very* long URLs which may cause problems with text
wrapping.
You can enable it on your own server by uncommenting
// define('LONGURL_KEY', 'true');
in config.php
Original comment by terence.eden
on 17 Nov 2009 at 10:25
made modification to batch api calls to expand short URLs. Also made the
display show
only the domain part of the link rather than the entire link (like on slashdot)
curious for feedback on the way I did it
Original comment by ldoug...@gmail.com
on 5 Dec 2009 at 10:26
Attachments:
let's do the simple way to make url's
http://php.net/manual/en/function.get-headers.php
and just get the redirect header :)
Original comment by necenzu...@gmail.com
on 13 May 2010 at 11:26
@necenzurat
Good job:-)
Original comment by cnye...@gmail.com
on 14 May 2010 at 1:53
how do you know which URL is a shortened URL? Couldn't resolving this for all
URLs
sometimes break the thumbnail code?
Original comment by ldoug...@gmail.com
on 16 May 2010 at 2:46
We now use Twitter Entities to expand all URLs
http://dev.twitter.com/pages/tweet_entities
Twitter's display guidelines say we still have to go via the URL shortner. But
you can modify your own twitter so it avoids bit.ly etc
Original comment by terence.eden
on 13 Jun 2011 at 12:10
Original issue reported on code.google.com by
cnye...@gmail.com
on 13 Oct 2009 at 3:41