Skip to content

app-ads.txt crawler according to "IAB Technology Laboratory"

Notifications You must be signed in to change notification settings

ramimoshe/app-ads.txt

Repository files navigation

app-ads.txt

app-ads.txt crawler according to "IAB Technology Laboratory"

NPM version NPM Downloads Node.js Version

install

  npm i app-ads-txt

How to use

    const AppAdsTxtCrawler = require('app-ads-txt').crawler;
    const appAdsTxtCrawler = new AppAdsTxtCrawler(options);
    const appAdsTxtData = appAdsTxtCrawler.crawlData('example.com');

Example of usage

input: example.com/app-ads.txt output:

{
    "appAdsUrl": "https://example.com/app-ads.txt",
    "data"     : {
        "variables": {},
        "fields"   :
            [{
                "domain"                : "example.com",
                "publisherAccountID"    : "104023",
                "accountType"           : "DIRECT",
                "certificateAuthorityID": "79929e88b2ba73bc"
            }]
    }
}

options:

{
  "proxyUrl": "http://user:[email protected]"
}

Exceptions

  • ERR_INVALID_URL: on invalid input url

How it works (by "IAB Technology Laboratory")

Follow these steps to transform the developer URL into a path to crawl for locating an appads. txt file.

  1. Extract the host name portion of the URL.
  2. Remove any “www.” or “m.” prefix present in the host name.
  3. Remove all but the first (and, if present, second) name from the host name which precedes the standard public suffix. For example: a. example.com simply remains example.com b. subdomain.example.com remains subdomain.example.com c. another.subdomain.example.com becomes subdomain.example.com d. another.subdomain.example.co.uk becomes subdomain.example.co.uk
  4. Append /app-ads.txt to that path.
  5. Crawlers should attempt to fetch the HTTPS version of the URL first, falling back to the HTTP version if SSL is unavailable.

License

MIT

About

app-ads.txt crawler according to "IAB Technology Laboratory"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published