Git Product home page Git Product logo

domainatrex's Introduction

Domainatrex

Domainatrex is a TLD parsing library for Elixir, using the Public Suffix list.

Build Status Inline docs Coverage Status Deps Status hex.pm version hex.pm downloads License

Installation

Add the following to your mix.exs


defp deps do
  [{:domainatrex, "~> 2.2.0"}]

Usage

Domainatrex should be able to handle all valid hostnames, it uses the Public Suffix List and is heavily inspired by the fantastic Domainatrix library for Ruby

iex> Domainatrex.parse("someone.com")
{:ok, %{domain: "someone", subdomain: "", tld: "com"}}

iex> Domainatrex.parse("blog.someone.id.au")
{:ok, %{domain: "someone", subdomain: "blog", tld: "id.au"}}

Changelog

2.2.0

  • Use Logger for logging

2.1.4

  • Pin a version of nimble_parsec to fix a compilation error on makeup (makeup has fixed this downstream, so when ex_doc updates makeup, this will no longer be required)

2.1.3

  • Merge a couple of minor PRs

2.1.2

  • Improve tests and docs slightly

2.1.1

  • Privatise Domainatrex.match/n and Domainatrex.format_response/2 as they are only ever intended for internal use

2.1.0

  • Better handle private domains. Private domains like *.s3.amazonaws.com are technically classed as TLDs (to my understanding?), it doesn't make a lot of sense to parse them this way.
  • Fetch a new copy of the public suffix list from The Internet on compile, falling back to a (now updated!) local copy.

2.0.0

  • Change the API from returning explicit results to {:ok, result} or {:error, result}. This is to be more uniform with other libraries I use and for better with usage. Sorry if this fucks up your day.

1.0.1

  • Fully update the tests to reflect changes in 2.0.0 (thanks for the PR @pbonney!)

domainatrex's People

Contributors

alenards avatar daareiza avatar lostkobrakai avatar pbonney avatar tedelex06 avatar zensavona avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.