Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple user-agent parsing library based on BrowserScope's UA database.

License

NotificationsYou must be signed in to change notification settings

channelme/uaparserl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

See build results on Travis CI

A simple user-agent parsing library based onBrowserScope's UA database.

Installation

uaparserl is tested with OTP from version 20 onwards. To use it, adduaparserl to your dependencies:

rebar

{deps,[  {uaparserl, {git,"https://github.com/channelme/uaparserl.git"}}]}.

mix

defprojectdo[deps:[{:uaparserl,git:"https://github.com/channelme/uaparserl.git"}]]end

Enable HiPE

If you want to use a HiPE compiled version, add following code to yourrebar.config.

{overrides, [    {override, uaparserl, [{erl_opts, [{d, 'ENABLE_HIPE'}, inline]}]}]}.

Usage

Important

Please note that this library returns captures "as is"; it is theresponsibility of the developer to ensure that results are properlyescaped when used in potentially harmful scenarios.

Also be aware that this library expects and returns strings. You mayneed to convert the return value to for correct use within your system.

Example

%% Obtain the resource files from BrowserScope's github repository>uaparserl:update().ok%% Parse>uaparserl:parse("Luminary/70 CFNetwork/978.0.7 Darwin/18.5.0").[{useragent,[{family,"Luminary"},             {major,"70"},             {minor,nil},             {patch,nil}]}, {os,[{family,"iOS"},      {major,"12"},      {minor,nil},      {patch,nil},      {patch_minor,nil}]}, {device,[{family,"iOS-Device"},          {brand,"Apple"},          {model,"iOS-Device"}]}]

Development

We welcome pull requests!

For local development, OTP21 or greater is required. Callmake withinthe project directory for a list of commands that can be used to aidyour development process.

Licence

Copyright 2020 Channel.me B.V.Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.

About

A simple user-agent parsing library based on BrowserScope's UA database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp