How to parse Baidu search result link? Url = parameter

Source: Internet
Author: User
How to parse Baidu search result link? Url parameters

  1. Query Baidu link? Ulr = real link form
  2. /*
  3. Getrealurl: get the URL address after 301 and 302 redirection by enenba.com
  4. @ Param str $ url query
  5. $ Return str: specifies the actual url of the targeted url.
  6. */
  7. Function getrealurl ($ url ){
  8. $ Header = get_headers ($ url, 1 );
  9. If (strpos ($ header [0], '000000') | strpos ($ header [0], '000000 ')){
  10. If (is_array ($ header ['location']) {
  11. Return $ header ['location'] [count ($ header ['location'])-1];
  12. } Else {
  13. Return $ header ['location'];
  14. }
  15. } Else {
  16. Return $ url;
  17. }
  18. }
  19. $ Input ='';
  20. $ Url = isset ($ _ GET ['URL'])? $ _ GET ['URL']: '';
  21. If (empty ($ url) exit ($ input );
  22. $ Urlreal = getrealurl ($ url );
  23. Echo 'actual url: '. $ urlreal;
  24. $ Urlreal = ltrim ($ urlreal, 'http ://');
  25. $ Search = '/ebac5573358cc3c0659257bfcf54 ([0-9a-f] +)/I ';
  26. Preg_match ($ search, $ url, $ r );
  27. $ Url_encode = $ r [1]; unset ($ r );
  28. Echo'
    Ciphertext: '. $ url_encode .'
    ';
  29. $ Urlreal_arr = str_split ($ urlreal );
  30. $ Url_encode_arr = str_split ($ url_encode, 2 );
  31. Echo'
    ';
  32. Echo $ input;
  33. ?>

Statement: The articles on cnbeta are not published by me. My analysis is only based on my own ideas. I just want to find a process. As for whether there are any results, I have my own conclusions. After carefully reading the long code of the Baidu result url, we found that only numbers and letters a to f in the password, that is, hexadecimal code. The hexadecimal format is from 0 to> 1-> 2-> 3-> 4-> 5-> 7-> 8-> 9-> a-> B-> c-> d-> e-> f I collected a series of URLs and counted the first code. Ebac5573358cc3c0659257bfcf54XX ...... the url corresponding to this code is 33 0 23 @ 13 P 03 '73 p 63! 32 1 22 A 12 Q 02 a 72 q 62 "31 2 21 B 11 R 01 B 71 r 61 #30 3 20 C 10 S 00 c 70 s 60 $37 4 27 D 17 T 07 d 77 t 67% 36 5 26 E 16 U 06 e 76 u 66 & 35 6 25 F 15 V 05 f 75 v 65 '34 7 24G 14 W 04g 74 w 64 (3b 8 2b H 1b X 0b h 7b x 6b) 3a 9 2a I 1a Y 0a I 7a y 6a * 39: 29 J 19 Z 09 j 79 z 69 + 38; 28 K 18 [08 k 78 {68, 3f <2f L 1f \ 0f l 7f | 6f-3e = 2e M 1e] 0e m 7e} 6e. 3d> 2d N 1d ^ 0d n 7d ~ 6d/3c? 2c O 1c _ 0c o 7c 6c

It should be a character in the ascii code table, but the order should be confused. However, this is the case in a single hexadecimal system: 3-> 2-> 1-> 0-> 7-> 6-> 5-> 4-> B-> a-> 9-> 8-> f-> e -> d-> c, four digits in one descending order, we can see that the total number is decreasing. But it is puzzled that the numbers from _ to 'are adjacent to the 0c and 73 in ascii. No way. I can't see the rule. let's look at the second-digit code ebac5573358cc3c0659257bfcf54XXYY .... The url corresponding to the YY code is 70 0 60 @ 50 P 40 '30 p 20! 71 1 61 A 51 Q 41 a 31 q 21 "72 2 62 B 52 R 42 B 32 r 22 #73 3 63 C 53 S 43 c 33 s 23 $74 4 64 D 54 T 44 d 34 t 24% 75 5 65 E 55 U 45 e 35 u 25 & 76 6 66 F 56 V 46 f 36 v 26 '77 7 67G 57 W 47g 37 w 27 (78 8 68 H 58X48 h 38x28) 79 9 69 I 59 Y 49 I 39 y 29 * 7a: 6a J 5a Z 4a j 3a z 2a + 7b; 6b K 5b [4b k 3b {2b, 7c <6c L 5c \ 4c l 3c | 2c-7d = 6d M 5d] 4d m 3d} 2d. 7e> 6e N 5e ^ 4e n 3e ~ 2e/7f? 6f O 5f _ 4f o 3f 2f

The secret of the second digit follows the ascending hexadecimal order. 0-> 1-> 2-> 3-> 4-> 5-> 7-> 8-> 9-> a-> B-> c-> d-> e -> f indicates a descending total. Look at the third group of ebac5573358cc3c0659257bfcf54XXYYZZ .... The url corresponding to the ZZ code is 84 0 94 @ a4 P b4 'C4 p d4! 85 1 95 A a5 Q b5 a c5 q d5 "86 2 96 B a6 R b6 B c6 r d6 #87 3 97 C a7 S b7 c c7 s d7 $80 4 90 D a0 T b0 d c0 t d0 % 81 5 91 E a1 U b1 e c1 u d1 & 82 6 92 F a2 V b2 f c2 v d2 '83 7 93G a3 W b3 g c3 w d3 (8c 8 9c H ac X bc h cc x dc) 8b 9 9b I AB Y bb I cd y dd * 8e: 9e J AE Z be j ce z de + 8f; 9f K af [bf k cf {df, 88 <98 L a8 \ b8 l c8 | d8-89 = 99 M a9] b9 m c9} d9. 8a> 9a N aa ^ ba n ca ~ Da/8b? 9b O AB _ bb o cb db

The order above is not explained: 4-> 5-> 6-> 7-> 0-> 1-> 2-> 3-> 4-> c-> B-> e-> f-> 8 -> 9-> a-> B, the total number of digits after the increment is not viewed yet, however, we can probably know that it is a group of four obfuscation hexadecimal obfuscation, so it increases or decreases, and a certain amount of data is required to judge. The next time you collect 1000 pieces of url data for determination.

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.