还原dabr的_t.co链接

推特的政策规定不允许第三方应用还原t.co链接,dabr也不例外。有人说可以在config.php里启用longurlplease服务来还原,不过页面上的链接虽然被还原了,但超链接仍然是t.co,点击时仍然无法访问。

在svn checkout到的dabr 494版中,可以这样还原:

打开 /common/twitter.php 搜索

Use the Entities to replace hyperlink URLs

,找到下面的

$url = $urls->url;

改为

if ($urls->expanded_url)
{
$url = $urls->expanded_url;
}
else
{
$url = $urls->url;
}

上传覆盖。

然后就可以看到t.co的链接被还原了,不过这个修改只能还原t.co。如果原链接是is.gd、bit.ly之类的话,那么修改之后仍然不变。

2 Comments so far

Trackbacks/Pingbacks

Leave a comment

Name(required)
Mail (required),(will not be published)
Website(recommended)

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://dupola.com),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.