Brad Lucas

A blog mostly about programming
October 19, 2017

Clojure Ads.txt Crawler Reporting Site

Continuing with the Ads.txt crawler has lead to the idea to store the crawler results in a database and have them available from a web site. This post introduces the first pass as such a site with the source code available in the following repository:

Ads.txt Review

As a quick review the Ads.txt standard is one where publishers can host a simple text file with the names of authorized ad networks that have permission to sell the publisher's inventory. There is a reference Python crawler for such files and I've built a crawler in Clojure as an alternative. See this link for a series of posts about the Ads.txt specification and the development of the crawler. The crawler project is here.

Crawler Library

The crawler previously developed has a command line interface but can be easily used as a library from another Clojure application. To facilitate this I've pushed a version of the crawler to It's listing is:

Luminus Framework

For a batteries included framework to build a Clojure web application I highly recommend Luminus. Start with the tutorial and get that working first. Then I'd suggest repeating the excercise with the database you are ultimately going to us. For my example I built the Guestbook with a local Postgres instance. Then, I knew I was going to deploy to Heroku so moved the app to Heroku as another excercise.


If you aren't familiar with Heroku it is another recommendation. You can once you are familiar with their overall system host test and development versions without any cost. This includes backing them with Postgres.

Here is the short list of commands to setup a site such as the Ads.txt site. The details are for you to research.

$ heroku apps:create ads-txt
$ heroku addons:create heroku-postgresql:hobby-dev
$ git push heroku master
$ heroku run lein run migrate

Bulk Loading

I added the ability to add domains to the system manually but to get things started it was important to allow bulk loading using the crawler library. Here are some sample commands with references to lists of domains that may be useful.

$ heroku run lein run -t --app ads-txt
$ heroku run lein run -t  --app ads-txt
$ heroku run lein run -t --app ads-txt

The Site

The above described site lets you request domains to be crawled for their Ads.txt file records and have the results stored. The site is currently running on Heroku at

Tags: clojure ads.txt