In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article analyzes "how to choose the API interface of the short URL on the market". The content is detailed and easy to understand. Friends who are interested in "how to select the short URL API interface on the market" can follow the editor's train of thought to read it slowly and deeply. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "how to select the API interface for short web addresses on the market".
At present, the mainstream short links on the market are Baidu, Tencent, Taobao and Sina. Their prefix domain names are http://dwz.cn, http://url.cn, http://tb.cn and http://t.cn. Here are their advantages and disadvantages.
Baidu short URL (http://dwz.cn)
Baidu short URL is a fee-based project with relatively more functions, according to the official introduction: Baidu short URL service can help you shorten a long URL and make it easier for you to share links on social networks and third-party platforms. put ads and so on. Baidu has an ultra-simple way to use short URL service: visit the home page of Baidu short URL https://dwz.cn to generate the corresponding short URL. You can also call Baidu short URL service API service to view data statistics and analysis!
In the past, the Baidu short URL needed a big station to apply, but later it became possible, but it took 2 hours to review, and now it's real-time.
Disadvantages: because at the beginning, the foundation is insufficient, the market does not like this set, change the seal or seal, there is almost no anti-sealing effect in Tencent app.
Tencent short links (http://url.cn, http://w.url.cn)
Url short links started as a countermeasure to http://t.cn 's URL compression service, then its Weibo went bankrupt, and officials did not stop http://url.cn parsing, but it also did not open the interface to the public.
Advantages: good stability, low failure rate, few anomalies, and low probability of being blocked in Wechat.
Disadvantages: because it is owned by one company, it has the authority to query the security center, it is relatively easy to detect, the probability of being blocked in QQ is relatively high, even the picture can be identified by AI artificial intelligence and then judged, and the short chain will be sealed directly, even if it is opened in the browser, it is prompted to be blocked.
Taobao short links (http://tb.cn)
Permission restrictions: only serve Ali's own e-commerce platform, other links cannot be used
(recommended) Sina short website (http://t.cn)
China is the first to do short link business, because of the huge market, Tencent dare not easily use the knife, more open, just because the use is too large, there have been several times in the past can not be used, http://t.cn will not be blocked at will, so Sina short URL is the best choice for short links with the best inclusiveness and market compatibility, although the official api interface service has been stopped But there are still a lot of API interfaces.
Description of Sina short URL API
Replace the "http://www.baidu.com"" part of the above Sina short URL api interface with the long link you need to generate the corresponding Sina short URL!
Sina short URL interface document
PHP call code:
$url = 'http://www.baidu.com';$api_url =' .urlencode ($url); $short_url = file_get_contents ($api_url); echo $short_url
JAVA call code:
Public static void main (String path []) throws Exception {URL u = new 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 call code:
Import urllib, urllib2, sys host =''path =' 'method =' GET' querys = '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) there are many online generation tools for other small platforms, how to choose
There are many third-party online generation tools on the market, which can be divided into three main categories. The first category is the online generation of short links for docking large platforms. This online generation tool can be selected and used all the time, even if the platform providing services is closed down. The short chain will not be affected.
The second is that the primary domain name registered by Xiaotai itself as the short-chain primary domain name, the resolution speed of the URL, the closing time, the hijacking phenomenon, and the compatibility of multiple platforms are not very stable, so you need to be careful in your choice.
The third kind is with the help of large platform short URL, but will nest a layer of small platform's own URL in the middle, to control time, this kind of operation concealment is stronger, not easy to be discovered, the malpractice is obvious: the influence speed does not say, will affect the later use.
On how to choose the short URL on the market API interface to share here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.