Extracting data from websites without API and calculating your needed calories - MyFitnessPal and Ruby + Mechanize
As a programmer I like to automate stuff, I love being able to extract the data I’m tracking and visualise and analyze it in many different ways.
I’ve been using MyFitnessPal for years, and I’ve collected a big amount of nutrition / weight data, as such I wanted to be able to play with that data in my own environment, unfortunately MyFitnessPal did not give me API access, even though I’ve asked twice.
As such I’ve decided to get that data in other means, Web crawling with Ruby and Mechanize is one option.
Let’s see how we can extract nutrition summary and weight data, meaning calories/macros and weight measurements.Read on →