In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares with you is about the API interface of Wechat domain name intercept detection and the official call document. The editor thinks it is quite practical, so I share it with you to learn. I hope you can get something after reading this article. Without saying much, let's take a look at it with the editor.
Background
Due to the strict restrictions on Wechat, domain names can easily be judged in several situations:
1. Induce sharing
2. Non-Wechat official website
3. The web page contains malicious fraudulent content
4. Access to the web page has been stopped
5. For browsing, please press the copy browser to open it.
6. Other situations, etc.
After the emergence of this problem, their own business will often be greatly affected. The purpose of using Wechat domain name detection API is to check the status of your domain name, to get the status of your domain name on Wechat in time, and whether the domain name has been blocked by Wechat. It is convenient for yourself to change the promotion domain name in time!
Wechat domain name detection interface sharing
Interface address: http://www.maoapi.cn/wxymjc?url_long=http://www.baidu.com
API description: replace the "http://www.baidu.com"" of the above Wechat domain name detection api interface with the link to be tested to use it.
How Wechat works
Send the domain name to be tested by simulating Wechat to carry out environmental testing.
Domain names have the following states:
1. The domain name can be accessed normally (not blocked by Wechat)
two。 The domain name was intercepted by Wechat
3. Non-Wechat official web page, continued visit will be converted to mobile preview mode
4. According to user complaints and detection by the Tencent Security website Security Center, the web page contains malicious fraudulent content and access has been stopped in order to maintain a green Internet environment.
5. The web page contains induced sharing, attention and other induced behavior, which has been complained by many people. In order to maintain the green Internet environment, access has been stopped.
6. For browsing, please press the copy browser to open it.
7. Other things, etc.
Description: a total of 2 return methods, 1 is normal. 2 is the above situation. All can not be opened properly in Wechat!
Interface document
Demo of PHP call:
$url = 'http://www.baidu.com';$api_url =' http://www.maoapi.cn/wxymjc?url_long=http://www.baidu.com;$short_url = file_get_contents ($api_url); echo $short_url
Demo of JAVA call:
Public static void main (String path []) throws Exception {URL u = new URL ("http://www.maoapi.cn/wxymjc?url_long=http://www.baidu.com");InputStream in = u.openStream (); ByteArrayOutputStream out = new ByteArrayOutputStream (); try {byte buf [] = new byte [1024]; int read = 0X 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"));}
Demo of Python call:
Import urllib, urllib2, syshost = 'http://www.maoapi.cn'path =' / wxymjc?'method = 'GET'querys =' url_long=http%3A%2F%2Fwww.baidu.com'bodys = {} url = host + path +'?'+ querysrequest = urllib2.Request (url) response = urllib2.urlopen (request) content = response.read () if (content): print (content)
Note:
1. When calling the api API, simply replace "http://www.baidu.com"" with the URL that needs to be detected.
2. When entering url, you must start with http (s): / /, otherwise the API may not be called.
Frequently asked questions:
The ② interface does not return a result. What happens?
Answer: sometimes the data returned by the API will be delayed. If the delay is not returned, the detection will fail, or it may be due to the expiration of the interface!
How long is the ③ detection interface valid? Is there a limit on the number of visits?
Answer: the interface will depend on the frequency of customer calls. Please consult customer service if you need it.
The above is the API API of Wechat domain name intercept detection and the official call document. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.