短链生成哪家强 新浪微博很张扬 t.cn

最快速的短网址接口,短链接服务,支持支持html5,IOS,Android,短信,微信分享防封,微博分享,抖音分享,且短网址生成微信防屏蔽,360防屏蔽,安全链接。

  • PHP调用代码:
    $url = 'http://www.baidu.com';
    $api_url = 'http://url-t.cn/tcn/api?key=czUl8gJuCD/tcn_url?url='.urlencode($url);
    $short_url = file_get_contents($api_url);
    echo $short_url;
  • JAVA调用代码:
public static void main(String path[]) throws Exception {
    URL u = new URL("http://url-t.cn/tcn/api?key=czUl8gJuCD&url=http%3A%2F%2Fwww.baidu.com");
    InputStream in = u.openStream();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try {
    byte buf[] = new byte[1024];
    int read = 0;
    while ((read = in .read(buf)) > 0) {
    out.write(buf, 0, read);
    }
    } finally {
    if ( in != null) {
    in .close();
    }
    }
    byte b[] = out.toByteArray();
    System.out.println(new String(b, "utf-8"));
    }
  • python调用代码:
import urllib, urllib2, sys

    host = 'http://url-t.cn'
    path = '/tcn/api'
    method = 'GET'
    querys = 'key=czUl8gJuCD&url=http%3A%2F%2Fwww.baidu.com'
    bodys = {}
    url = host + path + '?' + querys

    request = urllib2.Request(url)
    response = urllib2.urlopen(request)
    content = response.read()
    if (content):
    print(content)

以上都是收费的还很贵 ?怎么办怎么办 办法总是有的 !

你可能感兴趣的:(短链生成哪家强 新浪微博很张扬 t.cn)