[erlang-questions] user agent parsing.
Fri May 26 16:56:12 CEST 2017
Max, it depends on what for you do need the info from useragent. If you
don't need detailed info such as model of the phone for example, you can
use a fork of the useragent app, such as
https://github.com/brigadier/useragent , and modify it yourself for new
If you need to know detailed info, such as model of a phone or resolution,
you'd need to integrate database from https://browscap.org . But as you can
see, the base es very large, the full one weights about 130Mb, and naive
parsing with regexps would take a lot of CPU.
Often detailed version is not needed. If you sell ads buyers would be
interested maybe in android or ios, or maybe even in exact version of
android or ios, but not in the exact model of some obscure dumbphone. For
this dumbphone the ads would cost close to zero regardless of if you show
the name of the device or show 'unknown device' instead.
2017-05-26 14:39 GMT+03:00 Max Lapshin <max.lapshin@REDACTED>:
> I have a list of 250 000 of different useragents: not only browsers, but
> also devices and so on.
> I want to get operation system, kind of device, browser and version from
> them, so I need user agent parser.
> Right now I see two of them:
> I have checked them and they cannot parse lot of my useragent strings.
> What is the proper way to go here:
> 1) try to edit these libraries?
> 2) take some service with API?
> 3) just try to put ad-hoc hardcoded strings that will cover 90% of my
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions