1.2.20 • Published 3 years ago

deviceprofiler v1.2.20

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

This library is of part of mediascape european project framework. Aims to facility on identifing different type of device using a long data base reforced with a intelligent learning system. It is capable to learn different patterns based on user-agent token. The API can identify the followings type of devices: desktop,tablet,mobile and TV, but it's open to identify much more devices Types.

Installation

npm install deviceProfiler

Binary version:

sudo npm install deviceprofiler -g

Usage

Standalone version:

var deviceProfiler = require('deviceprofiler');
deviceProfiler.listen(8080);

Express version:

var express = require('express');
var app = express();
var server = require('http').createServer(app);
app.listen(6675, function () {
  console.log('Device Profiler API listening on  port 6675!')
})
var profilingServer = require('deviceprofiler').listen(app);

Web API

Identify device by user-agent:

 http://IP:PORT/checkDevice?agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.2883.87 Chrome/55.0.2883.87 Safari/537.36

Response:

{"deviceType":"desktop","fiability":0.7865514693138671,"userAgent":"\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.2883.87 Chrome/55.0.2883.87 Safari/537.36\""}

Is not identifying correctly ? Just give a chance to learn !

 http://IP:PORT/learn?device=Desktop&agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/55.0.2883.87 Chrome/55.0.2883.87 Safari/537.36

Will take awhile ... Response:

{"learn":true}

Import notes about learning

On time of learning, it's important to exit from terminal with Crtl + C and gives a response "Yes" to the question, otherwise the new learns will not be saved (roadmap:To be improved).

It is not recommend to learn when server is on production.

1.2.20

3 years ago

1.2.19

4 years ago

1.2.18

5 years ago

1.2.17

5 years ago

1.2.16

5 years ago

1.2.15

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.11

5 years ago

1.2.12

7 years ago

1.2.10

7 years ago

1.2.8

7 years ago

1.2.7

7 years ago

1.2.1

7 years ago

1.2.2

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago