<div dir="ltr">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 <a href="https://github.com/brigadier/useragent">https://github.com/brigadier/useragent</a> , and modify it yourself for new useragents. <div>If you need to know detailed info, such as model of a phone or resolution, you'd need to integrate database from <a href="https://browscap.org">https://browscap.org</a> . 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.</div><div><br></div><div>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.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-26 14:39 GMT+03:00 Max Lapshin <span dir="ltr"><<a href="mailto:max.lapshin@gmail.com" target="_blank">max.lapshin@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi.<div><br></div><div>I have a list of 250 000 of different useragents: not only browsers, but also devices and so on.</div><div><br></div><div>I want to get operation system, kind of device, browser and version from them, so I need user agent parser.</div><div><br></div><div><br></div><div>Right now I see two of them:</div><div><br></div><div><a href="https://github.com/ferd/useragent" target="_blank">https://github.com/ferd/<wbr>useragent</a><br></div><div><a href="https://github.com/chitika/uaparser" target="_blank">https://github.com/chitika/<wbr>uaparser</a><br></div><div><br></div><div>I have checked them and they cannot parse lot of my useragent strings.</div><div><br></div><div>What is the proper way to go here:</div><div><br></div><div>1) try to edit these libraries?</div><div>2) take some service with API?</div><div>3) just try to put ad-hoc hardcoded strings that will cover 90% of my records?</div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>