Long long strings generate two-dimensional code with public short URL service

Source: Internet
Author: User

Mobile platform with two-dimensional code to deal with, about the two-dimensional code, there is a good article recommended

At present I want to implement a function, scan QR code implementation, when using the scan Code app to go to the software market download, when the installation of the specified app automatically login, think of a scenario:

To download the APK link as a URL and follow the identity key used to log in,

However, such a string is very long ah!

We know that the QR code can only be encoded for text, and if the longer the string, the larger it may be, of course, scaling may also cause the scan to fall in the test rate.

What do we do?

The idea of a short domain name scheme for Weibo, often seen by t.cn, is only allowed in Weibo internal use, and there is no open API.

This time, or Baidu and Google solve the problem

http://goo.gl/

http://dwz.cn/

Among them, Goo.gl claims the fastest short domain name service, unfortunately for some reason, you understand. Even directly on-line QR code generation function, has saved the backstage thing.

OK, back to the point, Baidu can solve the problem, through the post interface to the specified URL can be longurl and tinyurl conversion, access to short URL directly automatically jump

Use the Universal Curl under Linux

" url=http://www.baidu.com/s?wd=%e7%9f%ad%e5%9f%9f%e5%90%8d%e6%9c%8d%e5%8a%a1&rsv_spt=1&issp=1&f =8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg" dwz.cn/create.php

Response:

{"TinyURL": "http:\/\/dwz.cn\/wp01k", "status": 0, "Longurl": "http://www.baidu.com/s?wd= short domain Name Service", "err_msg": ""}

Then use the short domain name to get the long address

" tinyurl=http://dwz.cn/wp01k " dwz.cn/query.php

Response:

{"Status": 0, "Longurl": "http://www.baidu.com/s?wd= short domain Name Service"}

If direct access will jump

Http://dwz.cn/wP01K

Long long strings generate two-dimensional code with public short URL service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.