Detect Google Mediapartners browser.

This commit is contained in:
Paulo Gustavo Veiga 2012-09-09 19:02:41 -03:00
parent e76a2372d0
commit 3f2b343a06

View File

@ -99,6 +99,13 @@ public class UserAgent implements Serializable {
// Format ApplicationName/ApplicationVersion (); // Format ApplicationName/ApplicationVersion ();
try { try {
// Mediapartners-Google -> Add sense robot
if(userAgentHeader.equals("Mediapartners-Google")){
this.product = Product.WEB_CRAWLER;
return;
}
int detailStart = userAgentHeader.indexOf('('); int detailStart = userAgentHeader.indexOf('(');
int detailEnd = userAgentHeader.indexOf(')'); int detailEnd = userAgentHeader.indexOf(')');
@ -114,9 +121,8 @@ public class UserAgent implements Serializable {
this.os = parseOS(productDetails); this.os = parseOS(productDetails);
if (userAgentHeader.contains("Googlebot") || userAgentHeader.contains("Mediapartners-Google")) { if (userAgentHeader.contains("Googlebot") || ) {
//"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" //"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
// Mediapartners-Google -> Add sense robot
this.product = Product.WEB_CRAWLER; this.product = Product.WEB_CRAWLER;
} else if (userAgentHeader.contains("MSIE")) { } else if (userAgentHeader.contains("MSIE")) {