#!/usr/bin/env nu let mf_auth_token = (secret-tool lookup miniflux-auth-token hyperreal) let mf_api_url = "https://miniflux.bsd.cafe/v1/feeds/counters" let unreads = ( ( curl \ -s \ -X GET \ -H "Content-Type: application/json" \ -H $"X-Auth-Token: ($mf_auth_token)" \ ($mf_api_url) ) | from json | get unreads | values ) if ($unreads | is-empty) { "0" } else { $unreads | math sum } # vim: sw=4 sts=4 ts=4 ai et ft=nu