├── .gitignore ├── screenshot.png ├── fonts ├── RobotoSerif-Regular.ttf └── RobotoCondensed-Regular.ttf ├── pkg ├── article.go ├── config.go ├── pdf.go └── website.go ├── go.mod ├── cmd └── newser.go ├── config.yaml ├── README.md └── go.sum /.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lnenad/newser/HEAD/screenshot.png -------------------------------------------------------------------------------- /fonts/RobotoSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lnenad/newser/HEAD/fonts/RobotoSerif-Regular.ttf -------------------------------------------------------------------------------- /fonts/RobotoCondensed-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lnenad/newser/HEAD/fonts/RobotoCondensed-Regular.ttf -------------------------------------------------------------------------------- /pkg/article.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | type Article struct { 4 | Title string 5 | Img string 6 | Link string 7 | Content string 8 | } 9 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lnenad/newser 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/go-pdf/fpdf v1.4.3 7 | github.com/gocolly/colly/v2 v2.1.0 8 | golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect 9 | gopkg.in/yaml.v2 v2.4.0 10 | ) 11 | -------------------------------------------------------------------------------- /cmd/newser.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/lnenad/newser/pkg" 7 | ) 8 | 9 | func main() { 10 | config := pkg.GetConfig() 11 | 12 | log.Printf("Loaded configuration: %+v", config) 13 | 14 | pdf := pkg.SetupPdf() 15 | counter := 0 16 | 17 | if len(config.Defs.Website) > 0 { 18 | for _, websiteDefinition := range config.Defs.Website { 19 | if websiteDefinition.Disable == 1 { 20 | continue 21 | } 22 | pkg.WriteArticlesFromWebsite(config, websiteDefinition, pdf, &counter) 23 | } 24 | } 25 | 26 | savePath := pkg.GetSavePath(config.Output.Directory, config.Output.Extension) 27 | err := pdf.OutputFileAndClose(savePath) 28 | if err != nil { 29 | log.Fatal("Error while outputting pdf file", err) 30 | } 31 | log.Printf("Written %v articles to pdf at %v", counter, savePath) 32 | } 33 | -------------------------------------------------------------------------------- /pkg/config.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | import ( 4 | "io/ioutil" 5 | "log" 6 | "path/filepath" 7 | "time" 8 | 9 | "gopkg.in/yaml.v2" 10 | ) 11 | 12 | type Defs struct { 13 | Website []WebsiteDefinition `yaml: "website"` 14 | } 15 | 16 | type Output struct { 17 | Extension string `yaml: "extension"` 18 | Directory string `yaml: "directory"` 19 | } 20 | 21 | type Font struct { 22 | Title int `yaml: "title"` 23 | Content int `yaml: "content"` 24 | } 25 | 26 | type Config struct { 27 | Defs Defs `yaml: "defs"` 28 | Font Font `yaml: "font"` 29 | Output Output `yaml: "output"` 30 | } 31 | 32 | func GetConfig() Config { 33 | data, err := ioutil.ReadFile("config.yaml") 34 | if err != nil { 35 | log.Fatal("No config.yaml found in root directory") 36 | } 37 | 38 | var config Config 39 | 40 | err = yaml.Unmarshal(data, &config) 41 | if err != nil { 42 | log.Fatalf("Error while parsing config: %v", err) 43 | } 44 | return config 45 | } 46 | 47 | func GetSavePath(directory, ext string) string { 48 | return filepath.Join( 49 | directory, 50 | time.Now().Format("2006-01-02-150405")+ext, 51 | ) 52 | } 53 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | font: 2 | title: 15 3 | content: 12 4 | 5 | output: 6 | extension: ".pdf" 7 | directory: "." 8 | 9 | defs: 10 | website: 11 | - index: "https://www.theverge.com" 12 | indexSelector: ".c-entry-box--compact" 13 | titleSelector: "div > h2 > a" 14 | linkSelector: "a" 15 | linkAttr: "href" 16 | articleContainerSelector: ".l-col__main" 17 | articleContentSelector: ".c-entry-content" 18 | ignoreString: "Verge Deals" 19 | collectOnly: 3 20 | disable: 0 21 | - index: "https://www.arstechnica.com" 22 | indexSelector: ".article" 23 | titleSelector: "header > h2 > a" 24 | linkSelector: "header > h2 > a" 25 | linkAttr: "href" 26 | articleContainerSelector: ".column-wrapper" 27 | articleContentSelector: ".article-content" 28 | ignoreString: "" 29 | removeElems: 30 | - "aside" 31 | - "figure" 32 | collectOnly: 3 33 | disable: 0 34 | - index: "https://www.engadget.com" 35 | indexSelector: "#module-dynamic-lede a" 36 | titleSelector: "h1" 37 | linkSelector: "" 38 | linkAttr: "href" 39 | linkPrefix: "https://www.engadget.com" 40 | articleContainerSelector: "#module-article-container" 41 | articleContentSelector: ".article-text" 42 | ignoreString: "" 43 | removeElems: 44 | - "figure" 45 | collectOnly: 3 46 | disable: 0 -------------------------------------------------------------------------------- /pkg/pdf.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | import ( 4 | "net/http" 5 | "path/filepath" 6 | "strings" 7 | "time" 8 | 9 | "github.com/go-pdf/fpdf" 10 | ) 11 | 12 | func SetupPdf() fpdf.Pdf { 13 | pdf := fpdf.New("P", "mm", "A4", "") 14 | pdf.AddPage() 15 | pdf.AddUTF8Font("robotoserif", "", filepath.Join("fonts", "RobotoSerif-Regular.ttf")) 16 | pdf.AddUTF8Font("robotocondensed", "", filepath.Join("fonts", "RobotoCondensed-Regular.ttf")) 17 | 18 | pdf.SetFont("robotoserif", "", 4) 19 | pdf.CellFormat( 20 | 0, 21 | 2, 22 | strings.Join( 23 | []string{"Generated at", time.Now().Format("2006-01-02T15:04:05Z07:00")}, 24 | " ", 25 | ), 26 | "", 27 | 2, 28 | "R", 29 | false, 30 | 0, 31 | "", 32 | ) 33 | pdf.SetFont("robotoserif", "", 16) 34 | pdf.CellFormat( 35 | 0, 36 | 25, 37 | strings.Join( 38 | []string{"Newspaper date", time.Now().Format("2006-02-01")}, 39 | " ", 40 | ), 41 | "", 42 | 2, 43 | "C", 44 | false, 45 | 0, 46 | "", 47 | ) 48 | return pdf 49 | } 50 | 51 | func WriteHeader(pdf fpdf.Pdf, header string) { 52 | pdf.SetFont("robotoserif", "", 11) 53 | pdf.CellFormat(0, 20, header, "", 2, "L", false, 0, "") 54 | } 55 | 56 | func WriteArticle(config Config, pdf fpdf.Pdf, article Article) { 57 | pdf.SetFont("robotoserif", "", float64(config.Font.Title)) 58 | pdf.MultiCell(0, 6, article.Title, "", "", false) 59 | pdf.CellFormat(0, 5, "", "", 2, "L", false, 0, "") 60 | pdf.SetFont("robotocondensed", "", float64(config.Font.Content)) 61 | pdf.MultiCell(0, 4.5, article.Content, "", "", false) 62 | pdf.CellFormat(0, 10, "", "", 2, "L", false, 0, "") 63 | } 64 | 65 | func RegisterImage(pdf fpdf.Pdf, urlStr string) { 66 | const ( 67 | margin = 10 68 | ht = 30 69 | fontSize = 15 70 | ) 71 | 72 | var ( 73 | rsp *http.Response 74 | err error 75 | tp string 76 | ) 77 | 78 | ln := pdf.PointConvert(fontSize) 79 | rsp, err = http.Get(urlStr) 80 | if err == nil { 81 | tp = pdf.ImageTypeFromMime(rsp.Header["Content-Type"][0]) 82 | infoPtr := pdf.RegisterImageReader(urlStr, tp, rsp.Body) 83 | if pdf.Ok() { 84 | imgWd, imgHt := infoPtr.Extent() 85 | pdf.Image(urlStr, pdf.GetX()+ln, pdf.GetY()+ln, 86 | imgWd, imgHt, false, tp, 0, "") 87 | } 88 | } else { 89 | pdf.SetError(err) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Newser 2 | 3 | A simple utility to crawl some news sites or other resources and download content into a pdf 4 | 5 | ![Screenshot](screenshot.png "Screenshot of a pdf on windows") 6 | 7 | ## Building 8 | 9 | Make sure you have `config.yaml` setup and `go` available, then run `go build cmd/newser.go` or just run it from source with `go run cmd/newser.go` 10 | 11 | ## Configuration 12 | 13 | Configuration file is used to guide the pdf building process, right now only website parsing is supported. 14 | 15 | The configuration file must have a top level `defs` (definitions), `font` and `output` properties. Right now `defs` must have a `website` property that contains website definitions. 16 | 17 | Default config is part of the source repo. 18 | 19 | ### Website Definitions 20 | 21 | ```yaml 22 | - index: "index-page-url" 23 | indexSelector: "css-selector-for-articles-index" 24 | titleSelector: "title-selector-for-articles" 25 | linkSelector: "selector-for-the-link-for-the-article-content" 26 | linkAttr: "attribute-to-gather-from-link-selector" 27 | articleContainerSelector: "article-container-selector" 28 | articleContentSelector: "article-content-selector" 29 | ignoreString: "if-found-in-article-article-will-be-ignored" 30 | removeElems: 31 | - "selector-in-article-html-to-remove" 32 | - "someother-selector-in-article-html-to-remove" 33 | collectOnly: 0 # 0 if you want to collect all articles, or limit to N articles 34 | disable: 0 # 1 if you want to disable this entry 35 | ``` 36 | 37 | The good thing is you can be as specific with selectors as you want. So if a website has multiple sections that contain articles, you can have multiple definitions for it and only get the articles that you want. 38 | 39 | ## Deps 40 | 41 | Top level deps are 42 | 43 | * fpdf - "github.com/go-pdf/fpdf" - For generating pdfs 44 | * yaml - "gopkg.in/yaml.v2" - For parsing yamls 45 | * colly - "github.com/gocolly/colly/v2" - For crawling websites 46 | 47 | ## Contributing 48 | 49 | Right now the project is still pretty much done for my desire to read news on my Supernote (awesome gadget btw) so if you wanna do something clever just create a PR. 50 | 51 | ## Contributors 52 | 53 | - [lnenad](github.com/lnenad) 54 | 55 | ## Licence 56 | 57 | Licence is free for personal but paid for commercial, get in touch if you want to use the utility or code for commercial purposes. 58 | 59 | ## Sponsors 60 | 61 | 62 | [CapSolver](https://www.capsolver.com/?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser) is an AI-powered service that automatically solves a range of CAPTCHAs, helping developers tackle CAPTCHA challenges encountered during web scraping. Whether you're extracting data from e-commerce sites, financial platforms, or social media, CapSolver supports CAPTCHAs like [reCAPTCHA V2](https://docs.capsolver.com/guide/captcha/ReCaptchaV2.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [reCAPTCHA V3](https://docs.capsolver.com/guide/captcha/ReCaptchaV3.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [hCaptcha](https://docs.capsolver.com/guide/captcha/HCaptcha.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [ImageToText](https://docs.capsolver.com/guide/recognition/ImageToTextTask.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [DataDome](https://docs.capsolver.com/guide/antibots/datadome.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [AWS](https://docs.capsolver.com/guide/captcha/awsWaf.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [Geetest](https://docs.capsolver.com/guide/captcha/Geetest.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=newser), [Cloudflare Turnstile](https://docs.capsolver.com/guide/antibots/cloudflare_turnstile.html?utm_source=github&utm_medium=banner_repo&utm_campaign=scraping&utm_term=cariddi) and more. With API integration and browser extensions options, and flexible pricing packages, CapSolver adapts to diverse web scraping needs and scenarios. -------------------------------------------------------------------------------- /pkg/website.go: -------------------------------------------------------------------------------- 1 | package pkg 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "regexp" 7 | "strings" 8 | "time" 9 | 10 | "github.com/go-pdf/fpdf" 11 | "github.com/gocolly/colly/v2" 12 | ) 13 | 14 | type WebsiteDefinition struct { 15 | Index string `yaml:"index,omitempty"` 16 | IndexSelector string `yaml:"indexSelector,omitempty"` 17 | TitleSelector string `yaml:"titleSelector,omitempty"` 18 | LinkSelector string `yaml:"linkSelector,omitempty"` 19 | LinkAttr string `yaml:"linkAttr,omitempty"` 20 | LinkPrefix string `yaml:"linkPrefix,omitempty"` 21 | ArticleContainerSelector string `yaml:"articleContainerSelector,omitempty"` 22 | ArticleContentSelector string `yaml:"articleContentSelector,omitempty"` 23 | IgnoreString string `yaml:"ignoreString,omitempty"` 24 | RemoveElems []string `yaml:"removeElems,omitempty"` 25 | CollectOnly int `yaml:"collectOnly,omitempty"` 26 | Disable int `yaml:"disable,omitempty"` 27 | } 28 | 29 | func WriteArticlesFromWebsite(config Config, wd WebsiteDefinition, pdf fpdf.Pdf, numArticles *int) { 30 | articlesChan := make(chan Article) 31 | 32 | crawlWebsite( 33 | wd, 34 | articlesChan, 35 | ) 36 | 37 | WriteHeader(pdf, wd.Index) 38 | 39 | messages := 0 40 | 41 | for { 42 | select { 43 | case article := <-articlesChan: 44 | if article.Content == "" { 45 | continue 46 | } 47 | messages++ 48 | (*numArticles)++ 49 | //registerImage(pdf, article.img) 50 | WriteArticle(config, pdf, article) 51 | 52 | if wd.CollectOnly > 0 && messages == wd.CollectOnly { 53 | return 54 | } 55 | //fmt.Println("received", article) 56 | case <-time.After(5 * time.Second): 57 | fmt.Println("Crawling completed, timeout after 5 seconds") 58 | return 59 | } 60 | } 61 | } 62 | 63 | func crawlWebsite(wd WebsiteDefinition, articlesChan chan Article) { 64 | c := colly.NewCollector() 65 | c.OnHTML(wd.IndexSelector, func(e *colly.HTMLElement) { 66 | imgs := e.ChildAttrs("a > picture > source", "srcset") 67 | title := e.ChildText(wd.TitleSelector) 68 | link := "" 69 | if wd.LinkSelector != "" { 70 | links := e.ChildAttrs(wd.LinkSelector, wd.LinkAttr) 71 | if len(links) > 0 { 72 | link = links[0] 73 | } 74 | } else { 75 | link = e.Attr("href") 76 | } 77 | if strings.Trim(title, " ") == "" { 78 | return 79 | } 80 | if link == "" { 81 | log.Fatalf("Invalid link selection, no links for fetching content found for website: %v, title: %v", wd.Index, title) 82 | } 83 | if wd.LinkPrefix != "" { 84 | link = wd.LinkPrefix + link 85 | } 86 | article := Article{ 87 | Title: string(title), 88 | Img: getImage(imgs), 89 | Link: link, 90 | } 91 | 92 | contentChan := make(chan string, 1) 93 | go getContent(article, wd, contentChan) 94 | article.Content = <-contentChan 95 | articlesChan <- article 96 | }) 97 | go c.Visit(wd.Index) 98 | } 99 | 100 | func getImage(imageSets []string) string { 101 | if len(imageSets) < 1 { 102 | return "" 103 | } 104 | 105 | images := strings.Split(imageSets[0], ",") 106 | 107 | return strings.Split(images[0], " ")[0] 108 | } 109 | 110 | var whitespaces = regexp.MustCompile(`\n\s+`) 111 | 112 | func getContent(a Article, wd WebsiteDefinition, contentChan chan string) { 113 | c := colly.NewCollector() 114 | c.OnError(func(r *colly.Response, e error) { 115 | log.Fatalf("Error while fetching article content for url: %v\nError: %v", a.Link, e) 116 | }) 117 | c.OnHTML(wd.ArticleContainerSelector, func(e *colly.HTMLElement) { 118 | if len(wd.RemoveElems) > 0 { 119 | children := e.DOM.Children() 120 | for _, re := range wd.RemoveElems { 121 | children.Find(re).Remove() 122 | } 123 | } 124 | content := whitespaces.ReplaceAllString(e.ChildText(wd.ArticleContentSelector), "\n") 125 | if wd.IgnoreString != "" && strings.Contains(content, wd.IgnoreString) { 126 | contentChan <- "" 127 | } 128 | contentChan <- content 129 | }) 130 | c.Visit(a.Link) 131 | } 132 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 3 | github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE= 4 | github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= 5 | github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= 6 | github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE= 7 | github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY= 8 | github.com/antchfx/htmlquery v1.2.3 h1:sP3NFDneHx2stfNXCKbhHFo8XgNjCACnU/4AO5gWz6M= 9 | github.com/antchfx/htmlquery v1.2.3/go.mod h1:B0ABL+F5irhhMWg54ymEZinzMSi0Kt3I2if0BLYa3V0= 10 | github.com/antchfx/xmlquery v1.2.4 h1:T/SH1bYdzdjTMoz2RgsfVKbM5uWh3gjDYYepFqQmFv4= 11 | github.com/antchfx/xmlquery v1.2.4/go.mod h1:KQQuESaxSlqugE2ZBcM/qn+ebIpt+d+4Xx7YcSGAIrM= 12 | github.com/antchfx/xpath v1.1.6/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= 13 | github.com/antchfx/xpath v1.1.8 h1:PcL6bIX42Px5usSx6xRYw/wjB3wYGkj0MJ9MBzEKVgk= 14 | github.com/antchfx/xpath v1.1.8/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= 15 | github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= 16 | github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs= 17 | github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= 18 | github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 19 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 20 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 21 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 22 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 23 | github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= 24 | github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 25 | github.com/go-pdf/fpdf v1.4.3 h1:0ZbUVyy3URshI6fCIaCD/iTVW33dqA8zbUHuGynxAPA= 26 | github.com/go-pdf/fpdf v1.4.3/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= 27 | github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= 28 | github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= 29 | github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI= 30 | github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA= 31 | github.com/gocolly/colly/v2 v2.1.0 h1:k0DuZkDoCsx51bKpRJNEmcxcp+W5N8ziuwGaSDuFoGs= 32 | github.com/gocolly/colly/v2 v2.1.0/go.mod h1:I2MuhsLjQ+Ex+IzK3afNS8/1qP3AedHOusRPcRdC5o0= 33 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 34 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= 35 | github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 36 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 37 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 38 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 39 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 40 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= 41 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= 42 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= 43 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 44 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= 45 | github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= 46 | github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= 47 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 48 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 49 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 50 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 51 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 52 | github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg= 53 | github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= 54 | github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o= 55 | github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak= 56 | github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= 57 | github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= 58 | github.com/phpdave11/gofpdi v1.0.13 h1:o61duiW8M9sMlkVXWlvP92sZJtGKENvW3VExs6dZukQ= 59 | github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= 60 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 61 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 62 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 63 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 64 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 65 | github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 66 | github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= 67 | github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245 h1:K1Xf3bKttbF+koVGaX5xngRIZ5bVjbmPnaxE/dR08uY= 68 | github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= 69 | github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI= 70 | github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= 71 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 72 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 73 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 74 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 75 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 76 | github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA= 77 | github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= 78 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 79 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 80 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 81 | golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 82 | golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9 h1:D0iM1dTCbD5Dg1CbuvLC/v/agLc79efSj/L35Q3Vqhs= 83 | golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= 84 | golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ= 85 | golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= 86 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 87 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 88 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 89 | golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 90 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 91 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 92 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 93 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 94 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 95 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 96 | golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 97 | golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 98 | golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= 99 | golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= 100 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 101 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 102 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 103 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 104 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 105 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 106 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 107 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 108 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 109 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 110 | golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= 111 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 112 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 113 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 114 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 115 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 116 | golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= 117 | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 118 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 119 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 120 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 121 | google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= 122 | google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 123 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 124 | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= 125 | google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= 126 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 127 | google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= 128 | google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 129 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= 130 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= 131 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= 132 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= 133 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 134 | google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 135 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 136 | google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 137 | google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= 138 | google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 139 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 140 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 141 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 142 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 143 | honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 144 | --------------------------------------------------------------------------------