Пример #1
0
<?php

# Setting time and memory limits
ini_set('max_execution_time', 0);
ini_set('memory_limit', '128M');
define('AC_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..');
# Including classes
require_once AC_DIR . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'RollingCurl.class.php';
require_once AC_DIR . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'AngryCurl.class.php';
# Initializing AngryCurl instance with callback function named 'callback_function'
$AC = new AngryCurl('callback_function');
# Initializing so called 'web-console mode' with direct cosnole-like output
$AC->init_console();
# Importing proxy and useragent lists, setting regexp, proxy type and target url for proxy check
# You may import proxy from an array as simple as $AC->load_proxy_list($proxy array);
$AC->load_proxy_list(AC_DIR . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR . 'proxy_list.txt', 200, 'http', 'http://google.com', 'title>G[o]{2}gle');
$AC->load_useragent_list(AC_DIR . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR . 'useragent_list.txt');
/* NOTE: IF USING request() - "on the fly" proxy server changing WILL apply
 * 
 * You may use request(URL, METHOD, POST_DATA, HEADERS, CURL OPTIONS) to create add new requests
 *  METHOD        may be GET or POST
 *  POST_DATA     may be an array of POST-params
 *  HEADERS       may be any HTTP headers
 *  CURL OPTIONS  may be any of supported by CURL
 */
$AC->request('http://ya.ru');
/* NOTE: IF USING get() - "on the fly" proxy server changing WILL apply
 * 
 * You may use shorcut get(URL, HEADERS, CURL OPTIONS) to create add new GET requests
 *  HEADERS       may be any HTTP headers
 *  CURL OPTIONS  may be any of supported by CURL