I'm James Hall

Peloton Pals

May 12, 2020 01:12 pm

If you ask anyone, they’ll tell you I’m a bit of a social butterfly, which is usually not the case with developers. I thrive in being around people, and I’m usually the one telling someone to turn up the music when I’m coding. I’ve always just been outgoing.

With this quarantine going on we’ve all been missing the tribal feelings you get when you hang out in crowds. Sure, you can zoom with your friends or family but if you’re on those all day, it feels exhausting to do it again casually after work.

My wife got us a peloton right around the time the quarantine started and I’m super glad she did. Well, I am now, at least. I kind of hated it when we first got it. I’m much more of a runner than a cyclist so I just couldn’t get into it.

Enter Pete Bernardo. He’s a good friend of mine and we’ve worked together on various projects/companies since 2014. We knew each other in South Florida by reputation but never really connected until Atlanta, which is always one of those fun stories to tell. He got a peloton way before we did and was killing it. I was telling him I had a hard time getting motivated to work on it, it’s a solitary ride (in person) by its design. Sure it has online classes and you’re supposed to feel together, but to me it’s just faces on a screen.

He offered to do the rides with me at the same time. Sure it wasn’t in person, but with this quarantine in effect, it was the closest thing you could do to work out together, and this time I know someone personally who would be suffering a the same time I would be. He’s been amazing for me on this. He’ll text me every morning before 8 or 830 the ride we should do, and we do it. I was talking with a few other friends in my personal slack instance and I threw all of us in a channel #peloton-pals just so we could chat about the rides we were doing.

Pete challenged us to ride as far as we could for an hour. We all did it and posted screenshots of our distance, much crap talking ensued.

The next time I was riding on a regular workout I started wondering about Peloton and if they have an API (as all developers do I’m sure). So as soon as I was off the bike and back in my seat (I showered!) I started looking into it. While I found an API, it unfortunatly didn’t really show any useful information that I wanted to use. It offered information for workouts and few other things, but I wanted info on my friends, what they were doing, etc.

What I did find were some unofficial API clients written in python that were discovered via browsing the site with the developer console running. Because the front-end is built in react, it consumes all it’s information from an API. I started to think about how I could use this to keep ourselves engaged and to push each other. I figured I could create a little app that found my followers, get their last workout, and post it to our #peloton-pals channel.

After some quick hacking I ended up getting this:

Peloton Pals

It’s helped us all stay motivated without having to do anything manually. In my next blog post I’ll talk more through the specifics of what I did to get this! If you’re on peloton, feel free to add me, it’s IMJAMESHALL.