https://github.com/leechy/uaparser
Simple Parser3 version of the ua-parser
https://github.com/leechy/uaparser
Last synced: 6 months ago
JSON representation
Simple Parser3 version of the ua-parser
- Host: GitHub
- URL: https://github.com/leechy/uaparser
- Owner: leechy
- Created: 2014-03-07T19:13:46.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-07T19:37:09.000Z (over 12 years ago)
- Last Synced: 2025-01-10T16:37:41.654Z (over 1 year ago)
- Language: OpenEdge ABL
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
UAParser
========
Simple [Parser3](http://www.parser3.ru) version of the [ua-parser](https://github.com/tobie/ua-parser).
It uses ua-parser's regexes.yaml converted to json due to lack of YAML support in Parser3. Slightly modified to include some new UA's.
Usage
-----
Copy `uaparser` folder to your CLASS_PATH.
```
@USE
uaparser/uaparser.p
@main[]
$r[^UAParser:parse[Mozilla/5.0 (iPhone^; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3]]
$r.ua.family
# -> "Mobile Safari"
$r.ua.major
# -> "5"
$r.ua.minor
# -> "1"
$r.os.family
# -> "iOS"
$r.os.major
# -> "5"
$r.os.minor
# -> "1"
$r.device.family
# -> "iPhone"
```