You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

4h 44m 56s logged

Hackfetch Can Finally Fetch

Hackfetch crossed a pretty big milestone today: it actually fetches things.

The goal is simple: build a Neofetch-style dashboard for Hack Club.

Run a single command and get a snapshot of your machine alongside your Hack Club activity.

hackfetch

and instantly see information like:

  • OS
  • Hostname
  • Username
  • Shell
  • Terminal
  • Editor
  • Hackatime
  • stats

Getting the system information was the easy part. Go makes it straightforward to grab things like the current user, hostname, operating system, and environment variables.

The harder problem was rendering everything cleanly beside an ASCII logo.

Each logo has different dimensions and line lengths, so I ended up building a small layout engine that calculates the width of every logo row and pads it dynamically before printing the corresponding information. Without that, the text column slowly drifts into the logo and the entire fetch screen looks broken.

Hooking into Hackatime

The more interesting work was integrating with the Hackatime API.Hackfetch reads your API key from:

~/.wakatime.cfg

authenticates with Hackatime, and pulls fresh coding statistics every time you run the command.Right now it can display:

Today’s coding time
Weekly coding time
Current streak
Top project
Most-used language

No browser.

No dashboard.

Just a terminal command.

0
13

Comments 1

@pkncoder

trans flag!!!!!!!!!!!!!! :3