From 1828701abd0a9051dc188fd26135c2bb3588c461 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 26 Mar 2012 13:40:00 +0200 Subject: [PATCH] add robot flag to parse_useragent --- ox/text.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ox/text.py b/ox/text.py index 9c8f65a..4d2fec2 100644 --- a/ox/text.py +++ b/ox/text.py @@ -63,6 +63,7 @@ UA_REGEXPS = { 'browser': [ '(Camino)\/(\d+)', '(chromeframe)\/(\d+)', + '(Google Web Preview).+Chrome\/(\d+)', '(Chrome)\/(\d+)', '(Epiphany)\/(\d+)', '(Firefox)\/(\d+)', @@ -281,6 +282,7 @@ def parse_useragent(useragent): 'string': string } break; + data['robot'] = data['browser']['name'] in ['Google Web Preview', 'Googlebot'] return data def removeSpecialCharacters(text):