Skip to content

nathpaiva/list-duplicate-domains

Repository files navigation

Netlify Status wakatime

List duplicate domains with Vanilla TS

This project creates two lists based on an input data. The first will be the list of all the URLs that have a duplicate spam_score, and the second will be a list of all the URLs with a duplicate domain_authority.

Example: The following simplified data would return the following JSON object:

Question

You will be given a large set of data with the following JSON format in data.json

{
  "idina_response":{
    "sources":[
      {
        "url":"example.com",
        "spam_score": 1,
        "matching_target_indexes":[
          0
        ],
        "matching_source_urls":[
          {
            "url":"example.com/news/current/",
            "page_authority":44
          }
        ],
        "domain_authority":95
      },
      // ...
    ]
  }
}
Example Data
{
  "idina_response":{
    "sources":[
      {
        "url":"example.com",
        "spam_score": 1,
        "domain_authority":95
      },
      {
        "url":"foo.com",
        "spam_score": 2,
        "domain_authority":100
      },
      {
        "url":"bar.com",
        "spam_score": 1,
        "domain_authority":100
      },
      {
        "url":"baz.com",
        "spam_score": 1,
        "domain_authority":12
      },
      {
        "url":"qux.com",
        "spam_score": 2,
        "domain_authority":401
      },
      {
        "url":"moz.com",
        "spam_score": 186,
        "domain_authority":99
      },
    ]
  }
}
Example output
{
  "duplicate_spam_scores": [
    "example.com",
    "bar.com",
    "foo.com",
    "baz.com",
    "qux.com"
  ],
  "duplicate_domain_authorities": [
    "foo.com",
    "bar.com"
  ]
}

Project developed with:

  • Typescript
  • HTML
  • CSS - SASS

Test developed with:

To run the project you need to install:

  • Node
  • Yarn or NPM (already installed with the node)

And clone the repository

$ git clone git@github.com:nathpaiva/form-rendering.git

Before starting the project you must install the dependencies:

$ yarn
$ npm install

To start the project you must run the command:

$ yarn start
$ npm start

If you want to run the tests

$ yarn test
$ npm test

To build the project, by running the command

$ yarn build
$ npm run build