<commit_before>package main

import (
	"fmt"
	logpkg "log"
	"os"

	"github.com/DreamItGetIT/statuscake"
)

var log *logpkg.Logger

func init() {
	log = logpkg.New(os.Stderr, "", 0)
}

func getEnv(name string) string {
	v := os.Getenv(name)
	if v == "" {
		log.Fatalf("`%s` env variable is required", name)
	}

	return v
}

func listTests(c *statuscake.Client) error {
	tt := c.Tests()
	tests, err := tt.All()
	if err != nil {
		return err
	}

	for _, t := range tests {
		fmt.Printf("* %d %s: %s\n", t.TestID, t.WebsiteName, t.Status)
	}

	return nil
}

func main() {
	username := getEnv("STATUSCAKE_USERNAME")
	apikey := getEnv("STATUSCAKE_APIKEY")

	c := statuscake.New(username, apikey)
	err := listTests(c)
	if err != nil {
		log.Fatal(err)
	}
}
<commit_msg>print more info from the command line tool<commit_after>package main

import (
	"fmt"
	logpkg "log"
	"os"

	"github.com/DreamItGetIT/statuscake"
)

var log *logpkg.Logger

func init() {
	log = logpkg.New(os.Stderr, "", 0)
}

func colouredStatus(s string) string {
	switch s {
	case "Up":
		return fmt.Sprintf("\033[0;32m%s\033[0m", s)
	case "Down":
		return fmt.Sprintf("\033[0;31m%s\033[0m", s)
	default:
		return s
	}
}

func getEnv(name string) string {
	v := os.Getenv(name)
	if v == "" {
		log.Fatalf("`%s` env variable is required", name)
	}

	return v
}

func listTests(c *statuscake.Client) error {
	tt := c.Tests()
	tests, err := tt.All()
	if err != nil {
		return err
	}

	for _, t := range tests {
		var paused string
		if t.Paused {
			paused = "yes"
		} else {
			paused = "no"
		}

		fmt.Printf("* %d: %s\n", t.TestID, colouredStatus(t.Status))
		fmt.Printf("  WebsiteName: %s\n", t.WebsiteName)
		fmt.Printf("  TestType: %s\n", t.TestType)
		fmt.Printf("  Paused: %s\n", paused)
		fmt.Printf("  ContactGroup: %d\n", t.ContactGroup)
		fmt.Printf("  ContactID: %d\n", t.ContactID)
		fmt.Printf("  Uptime: %f\n", t.Uptime)
	}

	return nil
}

func main() {
	username := getEnv("STATUSCAKE_USERNAME")
	apikey := getEnv("STATUSCAKE_APIKEY")

	c := statuscake.New(username, apikey)
	err := listTests(c)
	if err != nil {
		log.Fatal(err)
	}
}

{'fraction_non_alphanumeric': 0.17424242424242425, 'fraction_numerical': 0.010416666666666666, 'mean_word_length': 3.5053304904051172, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4588218', 'n_tokens_mistral': 937, 'n_tokens_neox': 882, 'n_words': 206}