Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Some days ago, an article N long ago suddenly became a hot topic for reading, after checking, I found that the page that I used that code for pr query could not normally get the URL PageRank value. Instead, I replaced it with a large segment of "In your email, google terms_of_service error message such as please send us the entire code displayed below. It seems that the original interface has expired.
However, the extension SearchStatus that I installed in the Firefox toolbar can still parse the prvalue of each page visited, find the plug-in package of SearchStatus to unbind the source code, and use a different verification code generation algorithm, after the original checksum is generated, another calculation is required. after the two computations, the correct ch parameter is obtained.
As a result, the new PHP version's Google PageRank query interface method came out after the ready-made js code transformation. After the local test, the terms_of_service error message is displayed after the user wants to upload the data to the server. After calculating the checksum step by step, it is found that the numbers on the local server and the server are different after several right shifts. This reminds us that the server is a 64-bit server. after the 32-bit system is displaced, the dropped bit will survive well. A trunkbitForce32bit method is added to shield the values after all arithmetic operations at a high level. This solves the extra bit problem in a 64-bit system. The result shows that the 32-bit Linux environment is incompatible because PHP automatically tries to convert int to float when the arithmetic processing overflows. When a negative overflow occurs, this operation correctly retains the precision in Windows, but there is a problem in Linux.
The following code:
$ A =-4294967295;
Echo dechex ($ )."
\ N ";
If ($ a <0) $ a + = 4294967296;
Echo dechex ($ )."
\ N ";
In Windows, the first echo can correctly output the 32-bit complement code of this negative number, while in 32-bit Linux, the output is the maximum number 0x80000000 that the int type can represent. Only by adding a large integer out of the integer range to the large negative number of the overflow in a clever way can the system restore the 32-bit low.
Using these unconventional methods, we finally developed the PHP script implementation (including the complete code) for this new version of the Google prvalue query interface compatible with Linux32, Linux64, and Windows ).
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.