~duncan-bayne/gemlint

8b2244a6afc4d0c24a27ca8d1e372b46f4dd8af8 — Duncan Bayne 1 year, 7 months ago c754f82 master
Only read body if it's Gemtext

I *think* this saves a bunch of bandwidth and speeds things up.
1 files changed, 2 insertions(+), 2 deletions(-)

M main.go
M main.go => main.go +2 -2
@@ 27,8 27,6 @@ func crawl(link string) {
	client := &gemini.Client{Insecure: true}
	// FIXME: ignoring errors
	response, _ := client.Fetch(link)
	buf := new(strings.Builder)
	io.Copy(buf, response.Body)

	switch response.Status {
	case 10:


@@ 95,6 93,8 @@ func crawl(link string) {
		}

		// FIXME: ignoring errors
		buf := new(strings.Builder)
		io.Copy(buf, response.Body)
		page, _ := gemtext.ParsePage(buf.String())

		for _, component := range page {