add user agent parser and update build configuration
This commit is contained in:
9
user-agent-parser/build.gradle.kts
Normal file
9
user-agent-parser/build.gradle.kts
Normal file
@@ -0,0 +1,9 @@
|
||||
plugins {
|
||||
id("elex-java")
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
// https://mvnrepository.com/artifact/nl.basjes.parse.useragent/yauaa
|
||||
implementation("com.github.ua-parser:uap-java:1.6.1")
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package kr.pe.elex.ua_parser;
|
||||
|
||||
import ua_parser.Client;
|
||||
import ua_parser.Parser;
|
||||
|
||||
public class UserAgentParser {
|
||||
|
||||
public static void main(String... args){
|
||||
final String uaStr = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36,gzip(gfe)";
|
||||
|
||||
Parser parser = new Parser();
|
||||
Client client = parser.parse(uaStr);
|
||||
System.out.println(client);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user