add robot flag to parse_useragent

This commit is contained in:
rolux 2012-03-26 13:40:00 +02:00
parent 224fcf7955
commit 1828701abd

View file

@ -63,6 +63,7 @@ UA_REGEXPS = {
'browser': [ 'browser': [
'(Camino)\/(\d+)', '(Camino)\/(\d+)',
'(chromeframe)\/(\d+)', '(chromeframe)\/(\d+)',
'(Google Web Preview).+Chrome\/(\d+)',
'(Chrome)\/(\d+)', '(Chrome)\/(\d+)',
'(Epiphany)\/(\d+)', '(Epiphany)\/(\d+)',
'(Firefox)\/(\d+)', '(Firefox)\/(\d+)',
@ -281,6 +282,7 @@ def parse_useragent(useragent):
'string': string 'string': string
} }
break; break;
data['robot'] = data['browser']['name'] in ['Google Web Preview', 'Googlebot']
return data return data
def removeSpecialCharacters(text): def removeSpecialCharacters(text):