PHP 122
API viết lại bài viết Tiếng Anh By Code on 17th August 2019 01:35:24 AM
  1. <?php
  2. function getlink($viet,$param){
  3.         $ch = @curl_init();
  4.         curl_setopt($ch, CURLOPT_URL, $viet);
  5.         $head[] = "Connection: keep-alive";
  6.         $head[] = "Keep-Alive: 300";
  7.         $head[] = "Accept: text/html,application/xhtml+xml,application/xml,application/json;q=0.9,*/*;q=0.8";
  8.         $head[] = "Accept-Charset: ISO-8859-1,utf-8; q=0.7,*; q=0.7";
  9.         $head[] = "Accept-Language: vi-VN;q=0.5,en;q=0.3";
  10.  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36');
  11.  curl_setopt($ch, CURLOPT_ENCODING, '');
  12.  curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
  13.  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  14.  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  15.  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  16. curl_setopt($ch, CURLOPT_POST, count($param));
  17. curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
  18.  curl_setopt($ch, CURLOPT_TIMEOUT, 12);
  19.  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 12);
  20.  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  21.         $result = curl_exec($ch);
  22.         curl_close($ch);
  23.     return $result;
  24. }
  25. $viet= 'https://www.congcuseo.net/article-rewriter/output';
  26. $text= 'The strong growth is owed to the entry of many foreign IT companies looking for talent in the country, the report said.';
  27. $data= 'data='.urlencode($text).'&submit=Submit';
  28. $xuat = getlink($viet,$data);
  29.  $lay = explode('<textarea id="textArea" rows="3" style="height: 270px;" class="form-control">',$xuat);
  30.  $lay = explode('</textarea>', $lay[1]);
  31.  echo $lay[0];
  32. ?>

PasteBin.Win is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste
', $lay[1]); echo $lay[0]; ?>

Login or Register to edit or fork this paste. It's free.