🌷 the cutsie hackatime helper
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add heartbeat check

+22
+22
main.go
··· 6 6 "fmt" 7 7 "os" 8 8 "runtime" 9 + "strings" 9 10 10 11 "github.com/charmbracelet/fang" 11 12 "github.com/charmbracelet/lipgloss/v2" ··· 114 115 formattedTime += fmt.Sprintf("%d seconds", seconds) 115 116 116 117 c.Println("\nSweet!!! Looks like your hackatime is configured properly! Looks like you have coded today for", fancy.Render(formattedTime)) 118 + 119 + c.Println("\nSending one quick heartbeat to make sure everything is ship shape and then you should be good to go!") 120 + 121 + err = client.SendHeartbeat(wakatime.Heartbeat{ 122 + Entity: "/home/kierank/Projects/akami/wakatime/main.go", 123 + Type: "file", 124 + Project: "akami", 125 + Language: "Go", 126 + Branch: "main", 127 + Category: "coding", 128 + IsWrite: true, 129 + LineCount: 197, 130 + ProjectRootCount: 5, 131 + Dependencies: []string{"bytes", "encoding/base64", "encoding/json", "net/http", "runtime", "time"}, 132 + Time: 1750643351, 133 + }) 134 + if err != nil { 135 + return errors.New("oh dear; looks like something went wrong when sending that heartbeat. " + bad.Render("Full error: \""+strings.TrimSpace(err.Error())+"\"")) 136 + } 137 + 138 + c.Println("\n🄳 it worked! you are good to go! Happy coding šŸ‘‹") 117 139 118 140 return nil 119 141 },