Handle Bing Preview and Chrome Mobile
This commit is contained in:
parent
1828701abd
commit
4bb4e31b48
1 changed files with 4 additions and 1 deletions
|
@ -40,6 +40,7 @@ SUFFIXES = ['ii', 'iii', 'jr', 'jr.', 'ph.d.', 'phd', 'sr', 'sr.']
|
||||||
|
|
||||||
UA_ALIASES = {
|
UA_ALIASES = {
|
||||||
'browser': {
|
'browser': {
|
||||||
|
'Chrome': '(CrMo)',
|
||||||
'Firefox': '(Fennec|Firebird|Iceweasel|Minefield|Namoroka|Phoenix|SeaMonkey|Shiretoko)'
|
'Firefox': '(Fennec|Firebird|Iceweasel|Minefield|Namoroka|Phoenix|SeaMonkey|Shiretoko)'
|
||||||
},
|
},
|
||||||
'system': {
|
'system': {
|
||||||
|
@ -61,6 +62,7 @@ UA_NAMES = {
|
||||||
}
|
}
|
||||||
UA_REGEXPS = {
|
UA_REGEXPS = {
|
||||||
'browser': [
|
'browser': [
|
||||||
|
'(BingPreview)\/(\d+)',
|
||||||
'(Camino)\/(\d+)',
|
'(Camino)\/(\d+)',
|
||||||
'(chromeframe)\/(\d+)',
|
'(chromeframe)\/(\d+)',
|
||||||
'(Google Web Preview).+Chrome\/(\d+)',
|
'(Google Web Preview).+Chrome\/(\d+)',
|
||||||
|
@ -103,6 +105,7 @@ UA_REGEXPS = {
|
||||||
'(Windows).+(WinNT4.0)' # Firefox
|
'(Windows).+(WinNT4.0)' # Firefox
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
UA_ROBOTS = ['BingPreview', 'Google Web Preview', 'Googlebot']
|
||||||
UA_VERSIONS = {
|
UA_VERSIONS = {
|
||||||
'browser': {},
|
'browser': {},
|
||||||
'system': {
|
'system': {
|
||||||
|
@ -282,7 +285,7 @@ def parse_useragent(useragent):
|
||||||
'string': string
|
'string': string
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
data['robot'] = data['browser']['name'] in ['Google Web Preview', 'Googlebot']
|
data['robot'] = data['browser']['name'] in UA_ROBOTS
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def removeSpecialCharacters(text):
|
def removeSpecialCharacters(text):
|
||||||
|
|
Loading…
Reference in a new issue