Adding a little blip of activity
While messing around with my .plan, I thought it would be nice if I could surface some of my real-time info on the site as well.
Following my thirty days of WhatPulse, I never really paid attention to the app again and it just disappeared in the background. Turns out, WhatPulse has both a Client and Web API that allows you to access either real-time info or pulsed info.
Anyway, here a link to an XML version of my stats. My Astro setup isnβt SSR-enabled, so the fetch I just only happens on build time and is rendered on the sidebar. You can see it in action at the bottom left.
1const response = await fetch(2 "https://api.whatpulse.org/user.php?user=codewisp&format=json"3);4
5const data = await response.json();6const {7 UptimeShort: uptime,8 Keys: keys,9 Clicks: clicks,10 DistanceInMiles: distance,11 Download: download,12 Upload: upload,13} = data;14
15const distanceInKm = distance * 1.609344;