https://github.com/Junker/mobiledetect
Common Lisp system for detecting mobile devices (including tablets) in User-Agent strings
https://github.com/Junker/mobiledetect
common-lisp user-agent user-agent-parser
Last synced: 17 days ago
JSON representation
Common Lisp system for detecting mobile devices (including tablets) in User-Agent strings
- Host: GitHub
- URL: https://github.com/Junker/mobiledetect
- Owner: Junker
- License: mit
- Created: 2023-11-12T11:44:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-18T05:10:52.000Z (about 1 year ago)
- Last Synced: 2025-02-21T03:14:38.332Z (2 months ago)
- Topics: common-lisp, user-agent, user-agent-parser
- Language: Common Lisp
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- trackawesomelist - mobiledetect (⭐3) - System for detecting mobile devices (including tablets) in User-Agent strings. MIT. (Recently Updated / [Oct 31, 2024](/content/2024/10/31/README.md))
README
# MobileDetect
MobileDetect is a lightweight Common Lisp system for detecting mobile devices (including tablets). \
The system will detect the device by comparing patterns against a given
User-Agent string.## Installation
This system can be installed from [UltraLisp](https://ultralisp.org/) like this:
```common-lisp
(ql-dist:install-dist "http://dist.ultralisp.org/"
:prompt nil)
(ql:quickload "mobiledetect")
```## Usage
```common-lisp
(setq *ua* "Mozilla/5.0 (Linux; Android 13; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Mobile Safari/537.36")(mobiledetect:mobilep *ua*)
;; T(mobiledetect:tabletp *ua*)
;; NIL(mobiledetect:browser *ua*)
;; :CHROME(mobiledetect:operating-system *ua*)
;; :ANDROIDOS(mobiledetect:mobile-device *ua*)
;; :PIXEL(mobiledetect:tablet-device *ua*)
;; NIL(mobiledetect:device-type *ua*)
;; :MOBILE
```## Credits
Using regexp list from https://mobiledetect.net/