Wechat URL short URL online generation of the latest wechat short URL generation platform recommendation

Time:2020-10-1

Brief description:

  • Wechat short website url.cn Link generation
  • The application scenarios of wechat short website are very wide, such as SMS marketing, email promotion, wechat marketing, QQ marketing, we media promotion, channel promotion, and so on. The reason is that the short URL can reduce the cost of promotion

Generation platform:

http://maiyurl.cn

http://www.sinadwz.cn

http://www.qqdwz.cn

API interface request mode:

GET

Parameters:

Parameter name

Mandatory

type

explain

url

yes

string

Links that need to be shortened

Request example

  • http://maiyurl.cn/tengxurl?url_long=http://www.baidu.com

Return to example

{“short_url”: “https://url.cn/54R8NCd”,”long_url”: “https://www.baidu.com/s?ie=UTF-8&wd=api”}

Return parameter description

Parameter name

type

explain

short_url

string

Shortened links

long_url

string

Original link

Request example

1. PHP request example:

$url = ‘http://www.baidu.com’;
$api_url = ‘ http://maiyurl.cn/weixin/shor…://www.baidu.com;
$short\_url = file\_get\_contents($api_url);
echo $short_url;

2. Java request example:

public static void main(String path[]) throws Exception {
URL u = new URL(” http://maiyurl.cn/weixin/shor…://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”));
}

3. Python request example:

import urllib, urllib2, sys
host = ‘ http://maiyurl.cn’
path = ‘/weixin/short’
method = ‘GET’
querys = ‘link=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)

remarks

  • For more interfaces, please visit the API interface official website
  • http://maiyurl.cn

Recommended Today

The first Python Programming challenge on the Internet (end)

Date of establishment: March 28, 2020Update Date: April 22, 2020 (end)Personal collection Tool.pywebsite:http://www.pythonchallenge.com/Note: please quote or change this article at will, just mark the source and the author. The author does not guarantee that the content is absolutely correct. Please be responsible for any consequences Title: the first Python Programming challenge on the web Find […]