Yandexの例を使用して、サイトでの作業を5分で自動化します。NetExportを使用したメール

他の人のサイトでいくつかのプロセスを自動化する必要がある場合があります。 サイトにログインし、何らかのファイルをダウンロードして、ページを開きます。 カールリクエストを正しく記述する方法を見つけるには、多くの場合、サイトコードを理解する必要があります。



私自身が私の人生を大幅に簡素化し、メールのチェックからテレビバンクでのデータのダウンロードまで、すべてを自動化するために使用している方法に注目します。 Yandex.mailの例を使用して、非常に迅速かつほとんどプログラミングなしでカールPHPスクリプトを生成し、任意のサイトに移動してコンテンツを自動的にダウンロードする方法を示します。



まず、Firefoxブラウザー用のFirebug拡張機能をインストールする必要があります。 その後、FireBug NetExportの拡張機能をインストールします



netExportの最新バージョンでは、アクションのネットワークログをHTTPアーカイブ形式で自動的に収集できます



興味のあるサイトに移動します。この場合はmail.yandex.ruになります。 その後、すべてのCookieとブラウザキャッシュをクリアすることをお勧めします。 ブラウザのステータスバーのバグアイコンをクリックして、FireBugを有効にします。 次に、念のため、ネットワークをオンにし、キャッシュをオフにします。



画像



NetExportプラグインがインストールされている場合、Firebugパネルに「エクスポート」ボタンとその横に黄色い丸が表示されます。 プラグインがすべてのアクションを自動モードで記録するには、ログのデフォルトディレクトリを設定し、黄色の丸をクリックする必要があります(図のように緑色に変わります)。



画像



今、あなたのアカウントの下に行き、あなたが必要なアクションを実行してください。 私の場合は、ログインして、文字でページに移動するだけです。 完了、緑色の円をクリックしてNetExportを停止します。 デフォルトで選択したフォルダに、いくつかのファイルが表示されました。 オンラインビューアーを使用して分析し、自動化のためのコードを記述できます。



ただし、これを自動的に実行できる小さなサービスを作成しました。 リンクhar2php.sharecoder.comをクリックすると、ログファイルをサービスにアップロードするだけで、PHPコードが書き込まれます。 私の場合、「passport-ckicheck.yandex.ru + 2010-02-18 + 10-15-21.har」というファイルをアップロードする必要があります:)このサービスは自分で行ったため、大きなログファイルをうまく消化できません。しかし、彼は彼のビジネスをよく知っています。 サービスは送信されたデータを保存せず、現在のセッションでのみ保持します。 ただし、セキュリティを強化するために、HARファイルをサービスに送信する前に、実際のユーザー名とパスワードをいくつかの文字に置き換えることをお勧めします。



Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  1. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  2. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  3. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  4. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  5. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  6. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  7. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  8. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  9. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  10. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  11. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  12. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  13. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  14. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  15. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  16. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  17. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  18. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  19. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  20. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  21. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  22. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  23. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  24. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );



  25. Copy Source | Copy HTML $cookie_file = 'cookie.txt' ; $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, 'https://passport.yandex.ru/passport?mode=auth' ); curl_setopt( $ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6' ); curl_setopt( $ch , CURLOPT_REFERER, 'http://mail.yandex.ru/' ); curl_setopt( $ch , CURLOPT_ENCODING, 'gzip,deflate' ); curl_setopt( $ch , CURLOPT_COOKIEJAR, $cookie_file ); curl_setopt( $ch , CURLOPT_COOKIEFILE, $cookie_file ); $header = array (); $header [] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ; $header [] = 'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7' ; $header [] = 'Accept-Language: ru,en-us;q=0.7,en;q=0.3' ; $header [] = 'Pragma: ' ; curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_POST, true ); $fields = array (); $fields [] = 'login=xxxxx' ; $fields [] = 'passwd=xxxxx' ; $fields [] = 'retpath=xxxxx' ; $fields [] = 'twoweeks=yes' ; curl_setopt( $ch , CURLOPT_POSTFIELDS, implode( '&' , $fields )); curl_setopt( $ch , CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch , CURLOPT_AUTOREFERER, true ); curl_exec( $ch ); curl_close( $ch );





コードは、いくつかの表面的な変更の後、意図したとおりに使用できます:)



PSまだサイトにログを送信することを恐れている人のために、私はサービスの現在のバージョンのソースコードを開きます:



Copy Source | Copy HTML



  1. <?php
  2. $ data = implode( '' 、file( $ uploadfile ));
  3. $ data = json_decode( $ data );
  4. リンク解除( $ uploadfile );
  5. $ lines = parseData( $ data );
  6. 関数 parseData( $ data
  7. {
  8. $行 = 配列 ();
  9. foreach$ data- > { 'log' }-> { 'pages' } as $ page ){
  10. $ exclude_url = array ();
  11. foreach$ data- > { 'log' }-> { 'entries' } as $ entrie ){
  12. if$ entrie- > { 'pageref' }!= $ page- > { 'id' }) continue ;
  13. if (! empty$ exclude_url [ $ entrie- > { 'request' }-> { 'url' }])) continue ;
  14. iffalseおよび preg_match( '/\d+-\d+-\d+T\d+:\d+:\d+\.(\d+)/'、$ entrie- > { 'startedDateTime' }、 $ m )){
  15. $ id = strftime( '%Y%m%d%H%M%S' 、strtotime( $ entrie- > { 'startedDateTime' }))。 $ m [ 1 ];
  16. } else {
  17. $ id = $ entrie- > { 'startedDateTime' };
  18. }
  19. $行 [ $ id ] [] = '$ cookie_file = \' cookie.txt \ ';' ;
  20. $行 [ $ id ] [] = '' ;
  21. $ headers = array ();
  22. foreach$ entrie- > { 'request' }-> { 'headers' } as $ header ){
  23. $ headers [ $ header- > { 'name' }] = $ header- > { 'value' };
  24. }
  25. $行 [ $ id ] [] = '$ ch = curl_init();' ;
  26. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_URL、\' '$ entrie- > { ' request ' }-> { ' url ' }。 ' \ ');' ;
  27. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_USERAGENT、\' '$ headers [ ' User-Agent ' ]。 ' \ ');' ;
  28. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_REFERER、\' '$ headers [ ' Referer ' ]。 ' \ ');' ;
  29. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_ENCODING、\' '$ headers [ ' Accept-Encoding ' ]。 ' \ ');' ;
  30. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_COOKIEJAR、$ cookie_file);' ;
  31. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_COOKIEFILE、$ cookie_file);' ;
  32. $行 [ $ id ] [] = '' ;
  33. $ lines [ $ id ] [] = '$ header = array();' ;
  34. $ lines [ $ id ] [] = '$ header [] = \' Accept: ' $ヘッダー [ 'Accept' ]。 '\'; ' ;
  35. $ lines [ $ id ] [] = '$ header [] = \' Accept-Charset: '$ヘッダー [ 'Accept-Charset' ]。 '\'; ' ;
  36. $ lines [ $ id ] [] = '$ header [] = \' Accept-Language: '$ヘッダー [ 'Accept-Language' ]。 '\'; ' ;
  37. $ lines [ $ id ] [] = '$ header [] = \'プラグマ:\ ';' ;
  38. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_HTTPHEADER、$ header);' ;
  39. スイッチ$ entrie- > { 'request' }-> { 'method' }){
  40. ケース 「GET」
  41. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_POST、false);' ;
  42. 休憩 ;
  43. ケース 「POST」
  44. if$ entrie- > { 'request' }-> { 'postData' }-> { 'mimeType' } == 'application / x-www-form-urlencoded' ){
  45. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_POST、true);' ;
  46. } else {
  47. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_POST、false);' ;
  48. }
  49. $行 [ $ id ] [] = '' ;
  50. $ lines [ $ id ] [] = '$ fields = array();' ;
  51. foreach$ entrie- > { 'request' }-> { 'postData' }-> { 'params' } as $ param ){
  52. $行 [ $ id ] [] = '$フィールド[] = \' ' $ param- > { 'name' }。 '='$ param- > { '値' }。 '\'; ' ;
  53. }
  54. $行 [ $ id ] [] = '' ;
  55. $ lines [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_POSTFIELDS、implode(\'&\ '、$ fields));' ;
  56. 休憩 ;
  57. デフォルト
  58. die (print_r( $ entrie ));
  59. }
  60. if$ entrie- > { 'response' }-> { 'status' } == '302' ){
  61. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_FOLLOWLOCATION、true);' ;
  62. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_AUTOREFERER、true);' ;
  63. $ exclude_url [ $ entrie- > { 'response' }-> { 'redirectURL' }] = true ;
  64. } else {
  65. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_FOLLOWLOCATION、false);' ;
  66. $行 [ $ id ] [] = 'curl_setopt($ ch、CURLOPT_AUTOREFERER、false);' ;
  67. }
  68. $行 [ $ id ] [] = 'curl_exec($ ch);' ;
  69. $行 [ $ id ] [] = 'curl_close($ ch);' ;
  70. $行 [ $ id ] [] = '' ;
  71. }
  72. }
  73. $行を 返します。
  74. }
  75. ?>



All Articles