All Projects → Dashlane → SwiftDomainParser

Dashlane / SwiftDomainParser

Licence: MIT license
A Full Swift Lightweight Framework that uses the Public Suffix list to Parse URLs

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to SwiftDomainParser

how-much
💰 iOS price list app using Firebase, Realm & more
Stars: ✭ 22 (-54.17%)
Mutual labels:  parse
logparser
Easy parsing of Apache HTTPD and NGINX access logs with Java, Hadoop, Hive, Pig, Flink, Beam, Storm, Drill, ...
Stars: ✭ 139 (+189.58%)
Mutual labels:  parse
sitemapper
parses sitemaps for Node.JS
Stars: ✭ 70 (+45.83%)
Mutual labels:  parse
djburger
Framework for safe and maintainable web-projects.
Stars: ✭ 75 (+56.25%)
Mutual labels:  parse
PyScholar
A 'supervised' parser for Google Scholar
Stars: ✭ 74 (+54.17%)
Mutual labels:  parse
parse-server-test-runner
A tool for programmatically starting Parse Server
Stars: ✭ 18 (-62.5%)
Mutual labels:  parse
shape-json
Module used to convert a flat json array into a nested json object with a predefined scheme
Stars: ✭ 31 (-35.42%)
Mutual labels:  parse
parse-author
Parse a person, author, contributor or maintainer string into an object with name, email and url properties following NPM conventions. Useful for the `authors` property in package.json or for parsing an AUTHORS file into an array of person objects.
Stars: ✭ 23 (-52.08%)
Mutual labels:  parse
mpq
Decoder/parser of Blizzard's MPQ archive file format
Stars: ✭ 28 (-41.67%)
Mutual labels:  parse
exjson
JSON parser and genarator in Elixir.
Stars: ✭ 71 (+47.92%)
Mutual labels:  parse
json struct
json_struct is a single header only C++ library for parsing JSON directly to C++ structs and vice versa
Stars: ✭ 279 (+481.25%)
Mutual labels:  parse
lilt
LILT: noun, A characteristic rising and falling of the voice when speaking; a pleasant gentle accent.
Stars: ✭ 18 (-62.5%)
Mutual labels:  parse
pfp-vim
A vim hex-editor plugin that uses 010 templates to parse binary data using pfp
Stars: ✭ 57 (+18.75%)
Mutual labels:  parse
spreadsheet
TypeScript/javascript spreadsheet parser, with formulas.
Stars: ✭ 40 (-16.67%)
Mutual labels:  parse
snapdragon-lexer
Converts a string into an array of tokens, with useful methods for looking ahead and behind, capturing, matching, et cetera.
Stars: ✭ 19 (-60.42%)
Mutual labels:  parse
section-matter
Like front-matter, but allows multiple sections in a single document.
Stars: ✭ 18 (-62.5%)
Mutual labels:  parse
pixl-xml
A simple module for parsing and composing XML.
Stars: ✭ 78 (+62.5%)
Mutual labels:  parse
parse-git-config
Parse `.git/config` into a JavaScript object. sync or async.
Stars: ✭ 55 (+14.58%)
Mutual labels:  parse
flex-bison-indentation
An example of how to correctly parse python-like indentation-scoped files using flex (and bison).
Stars: ✭ 32 (-33.33%)
Mutual labels:  parse
read-env
🔧 Transform environment variables into JSON object with sanitized values.
Stars: ✭ 60 (+25%)
Mutual labels:  parse

Domain Parser

Carthage Compatible

A full-swift simple library which allows to parse host to parse hostnames, and public suffix, using the Public Suffix List

This Library allows to know which is the domain name for a given URL.

What is Public Suffix List ?

PSL list all the known public suffix (like: com, co.uk, nt.edu.au, ...). Without this information we are not able to determine which part of a URL is the domain, Since a suffix can have more than one Label. The PSL includes ICANN (official top level domains) but also privates one (like us-east-1.amazonaws.com)

Examples:

URL Domain
sub.domain.co.uk domain.co.uk
auth.impala.dashlane.com dashlane.com

Usage

Initialization:

import DomainParser
let domainParse = try DomainParser()

You should use the same instance when you parse multiple URLs.

let domain = domainParser.parse("awesome.dashlane.com").domain
print(domain) // dashlane.com
let suffix = domainParser.parse("awesome.dashlane.com").suffix
print(suffix) // com
let suffix = domainParser.parse("awesome.dashlane.co.uk").suffix
print(suffix) // co.uk

Update the Public Suffist List

In the script folder, run:

swift UpdatePSL.swift 
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].