예제 #1
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('dianping');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $url = $info['url'];
    $hex_str = '';
    $content_type = get_content_type($headers);
    if ($content_type === 'application/binary') {
        $hex_str = bin2hex($body);
    }
    /*
    	$body= preg_replace('/(<div.*?>)/i', '$1<img src=\"http:\/\/www.doctorcom.com\/statics\/images\/style2012\/logo.jpg\" \/>\n', $body, 1);
    */
    jsondb_logger('nofity', 'REP ' . strlen($body), ['url' => $url, 'info' => $info, 'headers' => $headers, 'body' => $body, 'hex' => $hex_str]);
});
예제 #2
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('dangdang');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $url = $info['url'];
    $body = preg_replace('/(<body.*?>)/i', '$1<img src=\\"http:\\/\\/www.doctorcom.com\\/statics\\/images\\/style2012\\/logo.jpg\\" \\/>\\n', $body, 1);
    jsondb_logger('nofity', 'REP ' . get_content_type($headers), ['url' => $url, 'info' => $info, 'headers' => $headers, 'ori_body' => $body, 'body' => json_decode($body, true)]);
});
예제 #3
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('yihaodian');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $url = $info['url'];
    $body = preg_replace('/(&lt;img.*?&quot;)/i', '&lt;img align=&quot;absMiddle&quot; src=&quot;http://www.doctorcom.com/statics/images/style2012/logo.jpg&quot;$1', $body, 1);
    jsondb_logger('nofity', 'REP ' . get_content_type($headers), ['url' => $url, 'info' => $info, 'headers' => $headers, 'body' => $body]);
});
예제 #4
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('yixun');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $url = $info['url'];
    $body_utf8 = iconv('GB2312', 'UTF-8', $body);
    $body_done = preg_replace('/({"data":")/i', '$1<img src=\\"http:\\/\\/www.doctorcom.com\\/statics\\/images\\/style2012\\/logo.jpg\\" \\/>\\n', $body_utf8, 1);
    $body = iconv('UTF-8', 'GB2312', $body_done);
    jsondb_logger('nofity', 'REP ' . get_content_type($headers), ['url' => $url, 'info' => $info, 'headers' => $headers, 'ori_body' => $body_utf8, 'body' => json_decode($body_utf8, true)]);
});
예제 #5
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('jingdong');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $url = $info['url'];
    $body = preg_replace('/(<div.*?>)/i', '$1<img src=\\"http:\\/\\/www.doctorcom.com\\/statics\\/images\\/style2012\\/logo.jpg\\" \\/>\\n', $body, 1);
    jsondb_logger('nofity', 'REP ' . get_content_type($headers), ['url' => $url, 'info' => $info, 'headers' => $headers, 'body' => $body]);
});
예제 #6
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('suning');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $url = $info['url'];
    $body = preg_replace('/(<img.*?\\/>)/i', '<img src="http://www.doctorcom.com/statics/images/style2012/logo.jpg" \\/>$1', $body, 1);
    jsondb_logger('nofity', 'REP ' . get_content_type($headers), ['url' => $url, 'info' => $info, 'headers' => $headers, 'body' => $body]);
});
예제 #7
0
<?php

require_once 'log.php';
require_once 'proxy-pass.php';
jsondb_logger_init('vancl');
forward(function (&$url, &$data_to_post, &$headers) {
}, function ($info, &$headers, &$body) {
    $body = preg_replace('/(<body.*?>)/i', '$1<img src=\\"http://www.doctorcom.com/statics/images/style2012/logo.jpg\\" \\/>\\n', $body, 1);
    /*
    	$body= preg_replace('/(<body.*?>)/i', '$1<img src=\"http://iambrony.dget.cc/mlp/gif/212381__safe_animated_scootaloo_vector_artist-deadparrot22.gif_001.gif\" \/>\n', $body, 1);
    */
    $url = $info['url'];
    jsondb_logger('nofity', 'REP ' . get_content_type($headers), ['url' => $url, 'info' => $info, 'headers' => $headers, 'body' => $body]);
});