Skip to content

Common Lisp system for detecting mobile devices (including tablets) in User-Agent strings

License

Notifications You must be signed in to change notification settings

Junker/mobiledetect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 like this:

(ql-dist:install-dist "http://dist.ultralisp.org/"
                      :prompt nil)
(ql:quickload "mobiledetect")

Usage

(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/

About

Common Lisp system for detecting mobile devices (including tablets) in User-Agent strings

Topics

Resources

License

Stars

Watchers

Forks