2
List of user-agent strings
Some quick notes on the user-agent strings.
A user-agent string is a string sent in every HTTP request by client applications to servers. A string that includes useful information about the type and version of browser, operating system, language. The user-agent is a form of identification of an HTTP client, this still-identification - can be modified and altered to provide information (for example, through add-on for Firefox or other solutions).
There are many sites that offer lists of user-agent strings, some of these easily accessible and up to date are:
http://www.useragentstring.com/
http://www.useragents.org/
Other information about user-agent here.
Our simple to use with PHP / CURL (excerpt):
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => selectUseragent(), // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);
$ch = curl_init( $url );
curl_setopt_array( $ch, $options );
function selectUseragent() {
$input=array('Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)',
'Opera/9.52 (X11; Linux i686; U; fr)',
'Opera/9.52 (X11; Linux i686; U; en)',
'Opera/9.52 (Windows NT 6.0; U; en)',
'Mozilla/5.0 (X11; U; Linux x86_64; it; rv:1.9.0.1) Gecko/2008071717 Firefox/3.0.1',
'Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.0.1) Gecko/2008071222 Firefox/3.0.1',
'Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1',
'Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.0.1) Gecko/2008070400 SUSE/3.0.1-0.1',
'Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9b5) Gecko/2008041515 Firefox/3.0b5',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT) AppleWebKit/525 (KHTML, like Gecko) Version/3.1.2 Safari/525.21',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50',
'Mozilla/5.0 (Windows; U; Windows NT 5.1; es-AR; rv:1.7.5) Gecko/20041108 Firefox/1.0',
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; DFO-MPO Internet Explorer 6.0)',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4',
'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.6 (KHTML, like Gecko) Safari/125.12');
return $input[array_rand($input)];
}
RSS feed of comments to this article. TrackBack URI







