<commit_before>package main

import (
	"log"
	"log/syslog"
	"net/http"
	"strconv"

	"github.com/go-martini/martini"
	"github.com/martini-contrib/render"
)

// ~150k list limit

func maxLen(s string) int {
	if len(s) > 80 {
		return 80
	}
	return len(s)
}

func main() {
	m := martini.Classic()

	m.Use(render.Renderer())
	m.Use(func(w http.ResponseWriter, r *http.Request) {
		http.Redirect(w, r, "https://gogobbles.com"+r.RequestURI, http.StatusMovedPermanently)
	})

	if err := dbCheck(); err != nil {
		log.Fatal("Error: could not connect to mongodb")
	}

	mainLogger, err := syslog.New(syslog.LOG_ERR, "")
	if err != nil {
		log.Fatal("Error: could not start syslog")
	}

	// Site
	m.Get("/", func(r render.Render) {
		count, err := getIndexInfo()
		if err != nil {
			mainLogger.Err("Error: db query went bad: " + err.Error())
			r.HTML(500, "index", nil) // make a new tmpl for this
		}
		r.HTML(200, "index", TempIndex{ListCount: strconv.Itoa(count)})
	})

	m.Get("/api", func(r render.Render) {
		r.HTML(200, "api", nil)
	})
	m.Get("/faq", func(r render.Render) {
		r.HTML(200, "faq", nil)
	})
<commit_msg>revert<commit_after>package main

import (
	"log"
	"log/syslog"
	"strconv"

	"github.com/go-martini/martini"
	"github.com/martini-contrib/render"
)

// ~150k list limit

func maxLen(s string) int {
	if len(s) > 80 {
		return 80
	}
	return len(s)
}

func main() {
	m := martini.Classic()

	m.Use(render.Renderer())
	// m.Use(func(w http.ResponseWriter, r *http.Request) {
	// http.Redirect(w, r, "https://gogobbles.com"+r.RequestURI, http.StatusMovedPermanently)
	// })

	if err := dbCheck(); err != nil {
		log.Fatal("Error: could not connect to mongodb")
	}

	mainLogger, err := syslog.New(syslog.LOG_ERR, "")
	if err != nil {
		log.Fatal("Error: could not start syslog")
	}

	// Site
	m.Get("/", func(r render.Render) {
		count, err := getIndexInfo()
		if err != nil {
			mainLogger.Err("Error: db query went bad: " + err.Error())
			r.HTML(500, "index", nil) // make a new tmpl for this
		}
		r.HTML(200, "index", TempIndex{ListCount: strconv.Itoa(count)})
	})

	m.Get("/api", func(r render.Render) {
		r.HTML(200, "api", nil)
	})
	m.Get("/faq", func(r render.Render) {
		r.HTML(200, "faq", nil)
	})

{'fraction_non_alphanumeric': 0.19079837618403248, 'fraction_numerical': 0.017140279657194408, 'mean_word_length': 3.508130081300813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6209567', 'n_tokens_mistral': 973, 'n_tokens_neox': 897, 'n_words': 197}