<?php
// The following code is required to properly run Xedant.com Human Emulator
require("../Templates/xweb_human_emulator.php");
// function for generation accept string
function generate_accept($len)
{
$r = "";
$allowedSymbols = array("text/html", "image/png", "image/jpeg", "image/gif", "image/x-xbitmap","text/plain", "q=0.5", "text/html", "text/x-dvi", "q=0.8", "text/x-c","audio/*","q=0.2", "audio/basic","image/gif", "image/x-xbitmap", "image/jpeg", "image/pjpeg", "application/x-shockwave-flash", "application/vnd.ms-excel", "application/vnd.ms-powerpoint", "application/msword","*/*");
for ($i=0; $i<$len; $i++)
{
$rand=array_rand($allowedSymbols);
$rand=array_rand($allowedSymbols);
$r.=$allowedSymbols[$rand].",";
}
$r = substr($r,0,strlen($r)-1);
$r="Accept: ".$r.";";
return $r;
}
// aply browser data
$browser->set_accept(generate_accept(rand(1,7)));
$browser->set_accept_encoding("gzip, deflate");
$browser->set_user_agent("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)");
// clear cash
$browser->clear_cash();
// navigate to ip pages for check browser data. see field Accept:
$browser->navigate("http://www.ippages.com/?version=full");
// wait on browser
$browser->wait_for(60,1);
// Quit
$app->quit();
?>
Blog about the Web Human Emulator. Web Human Emulator scripts samples and scripts descriptions.
Monday, February 21, 2011
Function for generation accept string in Web Human Emulator.
Example for generate and set browser data - Accept, User Agent etc.
Ярлыки:
human emulator,
human emulator scripts
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment