uap-core icon indicating copy to clipboard operation
uap-core copied to clipboard

device replacement for user agent

Open ohady75 opened this issue 8 years ago • 3 comments

I have the following user agent which I want to extract Device information (mountain lion on MAC as I understand) from, but can't find any way or suitable regex from the existing file. anyone has an idea?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/6.2.8 Safari/537.85.17

Thanks all.

ohady75 avatar Nov 01 '17 10:11 ohady75

The parsing result is as follows:

ua: { family: 'Safari', major: '6', minor: '2', patch: '8' },
  os: 
   { family: 'Mac OS X',
     major: '10',
     minor: '8',
     patch: '5',
     patchMinor: null },
  device: { family: 'Other', brand: null, model: null } }

The only interesting information we get is the OS but we cannot determine the device itself. We cannot say if it's a MacBook or a Mac. Well we could detect that the device is a Desktop computer. But that's it.

commenthol avatar Nov 04 '17 20:11 commenthol

thanks for the answer. what will be the implementation for getting result for Device = 'Desktop Computer' or 'MAC'?

ohady75 avatar Nov 05 '17 12:11 ohady75

It could be

  - regex: '\(Macintosh; Intel '
    model_replacement: ''
    device_replacement: 'Mac'

in the device_parsers: section

misdoro avatar Jan 22 '20 19:01 misdoro