Skip to content
/ adstxt Public

Quickly and correcty fetch and parse ads.txt files with Go.

Notifications You must be signed in to change notification settings

ayang64/adstxt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c2fe443 · Feb 27, 2019

History

16 Commits
Sep 25, 2017
Feb 27, 2019
Nov 22, 2017
Feb 27, 2019

Repository files navigation

adstxt

Implements the ads.txt spec described at the link below:

https://iabtechlab.com/ads-txt/

The spec is pretty simple. This package simlpy parses the ads.txt file.

Quick Start

package main

import (
	"github.com/ayang64/adstxt"
	"log"
	"time"
)

func main() {

	ctx, cancel := context.WithTimeout(context.Background, time.Millisecond*500)
	defer cancel()

	ads, err := adstxt.Fetch(ctx, "https://www.example.com/ads.txt", "https://www.example2.com/ads.txt")

	if err != nil {
		log.Printf("error: %v", err)
		return
	}

	log.Printf("ads: %#v\n", ads)
}

TODO

Finish code to asynchronously fetch ads.txt files with cancellation.

About

Quickly and correcty fetch and parse ads.txt files with Go.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages