Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

miguelmota/adstxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adstxt

Crawls website for ads.txt entries.

Install

npm install adstxt

API

  • crawl(uri) -> Promise({object[]})

    • {string} uri - website domain or uri

Usage

const { crawl } = require('adstxt')

;(async () => {

console.log(await crawl('nytimes.com'))

/*
[
  {
    "crawlUri": "https://nytimes.com/ads.txt",
    "siteDomain": "nytimes.com",
    "adsystemDomain": "c.amazon-adsystem.com",
    "sellerAccountId": "3030",
    "accountType": "direct",
    "tagId": "",
    "entryComment": ""
  },
  ...
]
*/

console.log(await crawl('http://www.dailymail.co.uk/'))

/*
[
  {
    "crawlUri": "http://dailymail.co.uk/ads.txt",
    "siteDomain": "dailymail.co.uk",
    "adsystemDomain": "tremorhub.com",
    "sellerAccountId": "z87wm",
    "accountType": "reseller",
    "tagId": "1a4e959a1b50034a",
    "entryComment": "US"
  },
  ...
]
*/

})()

CLI

npm install -g adstxt
$ adstxt nytimes.com

/*
[
  {
    "crawlUri": "https://nytimes.com/ads.txt",
    "siteDomain": "nytimes.com",
    "adsystemDomain": "c.amazon-adsystem.com",
    "sellerAccountId": "3030",
    "accountType": "direct",
    "tagId": "",
    "entryComment": ""
  },
  ...
]
*/

Test

npm test

Resources

License

MIT

Releases

No releases published

Packages

No packages published