微信分享传播的时候,域名常常被拦截,有的时候咱们购买的域名直接就是被拦截的等等,为了不你们走弯路,今天告诉分享给你们一个我正在使用的的微信域名检测工具api
接口地址:微信
http://www.qqdwz.cn/ymjcapi?url_long=http://www.baidu.com 工具
接口说明:url
把上面的微信域名检测api接口的"http://www.baidu.com"替换成须要检测的连接便可使用!spa
返回说明:code
{"status":1,"msg":"域名正常"} blog
{"status":0,"msg":"域名被封"}接口
PHP调用演示:utf-8
$url = 'http://www.baidu.com'; $api\_url = 'http://www.qqdwz.cn/ymjcapi?url\_long?url\_long=http://www.baidu.com; $short\_url = file\_get\_contents($api\_url); echo $short\_url;
JAVA调用演示:rem
public static void main(String path\[\]) throws Exception { URL u = new URL("http://www.qqdwz.cn/ymjcapi?url\_long?url\_long=http://www.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://www.qqdwz.cn' path = '/ymjcapi?url\_long' method = 'GET' querys = 'url\_long=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)