[PHP] 用PHP模拟登录WAP飞信实现飞信发送 →→→→→进入此内容的聊天室

来自 , 2021-04-16, 写在 PHP, 查看 198 次.
URL http://www.code666.cn/view/75b9b6dc
  1. $post = array(
  2.         'msg' => 'Hello Fetion',
  3. );
  4. $curl = curl_init('http://f.10086.cn/im/user/sendMsgToMyselfs.action');
  5. curl_setopt($curl, CURLOPT_HEADER, 0);
  6. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  7. curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);        // 注意这里!
  8. curl_setopt($curl, CURLOPT_POST, 1);
  9. curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
  10. $result = curl_exec($curl);
  11. curl_close($curl);
  12.  
  13.  
  14. $post = array(
  15.         'searchText' => '18700008888',
  16. );
  17. $curl = curl_init('http://f.10086.cn/im/index/searchOtherInfoList.action');
  18. curl_setopt($curl, CURLOPT_HEADER, 0);
  19. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  20. curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);        // 注意这里!
  21. curl_setopt($curl, CURLOPT_POST, 1);
  22. curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
  23. $result = curl_exec($curl);
  24. curl_close($curl);
  25.  
  26.  
  27. preg_match('/toinputMsg\.action\?touserid=(\d+)/si', $result, $matches);
  28. $userid = isset($matches[1]) ? $matches[1] : '';
  29.  
  30.  
  31. $post = array(
  32.         'msg' => 'Hello Fetion',
  33. );
  34. $curl = curl_init('http://f.10086.cn/im/chat/sendMsg.action?touserid='.$userid);         // 注意这里!
  35. curl_setopt($curl, CURLOPT_HEADER, 0);
  36. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  37. curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);        // 注意这里!
  38. curl_setopt($curl, CURLOPT_POST, 1);
  39. curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
  40. $result = curl_exec($curl);
  41. curl_close($curl);

回复 "用PHP模拟登录WAP飞信实现飞信发送"

这儿你可以回复上面这条便签

captcha