Keystone-Technologies / keystone-technologies.github.io

1 stars 0 forks source link

Nutrition Tracking #23

Closed JDorpinghaus closed 8 years ago

JDorpinghaus commented 8 years ago

Problem

Tracking food/caloric intake for weight loss/gain is too tedious and time consuming. Many tools exist to make this process better (specifically within college campus dining facilities), but it's difficult to use them without some kind of integration.

Proposal

A large number of prominent colleges in the United States (Mizzou, The Ohio State University, Iowa State, Purdue, Michigan State to name a few) utilize the NetNutrition system to plan meals for their dining halls. This is an awesome program - each day, hundreds of food items are populated on the day's online menu, each associated with an extremely specific standard Nutrition Facts label, all available to be browsed by students. Students can even create mock meals to see total nutrition facts. This is the first useful tool.

The second useful tool is the king of calorie counting/exercise tracking apps, MyFitnessPal. This app allows users to easily create plans to meet their weight loss/gain goals by adding foods they've eaten and exercises they've performed. But the process of scrolling through items on NetNutrition, clicking each item to view the Nutrition Facts label, and manually entering the data into MyFitnessPal is extremely tedious and takes forever.

This process needs to be automated.

JDorpinghaus commented 8 years ago

User Interface

Backend

JDorpinghaus commented 8 years ago

A NetNutrition API specifically for accessing Harvard's meal details exists, called the CS50 Food API. A free API key appears to be the only authentication used.

A resource for scraping data from MyFitnessPal.

Example HTML-formed Nutrition Label Image of Nutrition Label

s1037989 commented 8 years ago

WOW! This is an extremely well-thought out problem and proposal!

Question, coming from your discussion of the Backend. Are you suggesting that college students would visit the new My Net Nutrition Pal (for lack of a better name) instead of NetNutrition in order to submit their foods to MyFitnessPal?

If so, what do you think about the issues involved with (i.e. Marketing) to get this information in front of the students, especially when they're already familiar with NetNutrition? Regarding familiarity, all they should have to do is become aware that this new product exists and immediately make the switch, simply because of the manual and tedious process of manually copying data from one system to another. However, I assume, that the school has been marketing NetNutrition to students to make them all aware of that. Do you think the school would market this new product in addition to / instead of NetNutrition?

If the answer to my question above is no, I'm not fully following you on how this work. :) And I'm pretty sure you're suggesting the former.

EDIT: For the latter... I'm wondering now if you were saying that using NetNutrition outright wouldn't even be necessary? That is, students would use the king of calorie counting apps, MyFitnessPal, and simply need to add their food. But to know what to manual enter for their food, they need to look to NetNutrition. I was first under the impression that they were using NetNutrition to browse food for what they might like to eat. But perhaps on second look I'm thinking now that they use NetNutrition only to get the details of the food that they did eat, and this then is where the automation becomes very feasible.

Current scenario: Student goes to cafeteria, buys a hamburger. Wants to enter that data into MyFitnessPal, goes to NetNutrition to look up the data, then manually enters that data into MyFitnessPal.

Proposed scenario: Student goes to cafeteria, buys a hamburger. Wants to enter data into MyFitnessPal, goes to My Net Nutrition Pal to look up the data, and presses the send to MyFitnessPal button. DONE! So much easier. This would work by MNNP having a copy of the NetNutrition database (per se) and a connection with the MyFitnessPal API.

Possible problem: often times EULAs specifically outlaw screen scraping.

Man, I like it!

s1037989 commented 8 years ago

Another question... I think you want to scrape the nutrition data from NetNutrition in order to post it to MyFitnessPal? Is that correct?

But in your last comment, you offered a resource for scraping data from MyFitnessPal. What data would you want / need to scrape from MyFitnessPal?

This is a really interesting problem you're proposing! I'm not hijacking the thread here, I just want to draw a parallel... I've had similar thought processes towards movies. I keep track of all the movies I want to see in my Netflix DVD queue. Sometimes I like to pick up a movie from Redbox. When I do so, I discover other movies I'd like to see. I wish there was an easier way to add to my Netflix queue a movie that I found that I like on Redbox.

Would you agree that this is a very similar parallel?

I would really like work with you to try to figure out a solution to this type of problem. I think the problem that you proposed, while very specific, can easily be generalized very quickly! I think we could target your specific use case and try to create a more generalized approach to solving this problem for a vast array of different use cases!

I'm thinking of something like IFTTT (If This Then That). IFTTT seems to be a highly generalized approach to connecting a wide variety of completely disconnected tools, and doing so in very unique ways. Perhaps Zapier might be more applicable here. (Discussion of comparison between the two, for reference.)

Off hand, I wonder if either of those could serve as viable solutions or models for solutions to this problem?

s1037989 commented 8 years ago

Here's another approach to how this could work, for NetNutrition. They would use NetNutrition as normal. When they want to upload the data from NetNutrition to MyFitnessPal, they could quickly snap a snapshot of their screen (assuming this is a 95%+ mobile platform base) which would grant them the opportunity to share that screenshot via an array of options: text messaging, email, dropbox, etc... One of those options could be My Net Nutrition Pal. MNNP would then receive this screen shot, parse it (OCR) and then upload that data to MyFitnessPal!

It's not 100% automated, but it gives the user control over what they want to sync fairly easily, and it allows them to stay with the familiar NetNutrition app that they've become accustomed to.

One thing to consider when it comes to solving problems like this... Solve the problem in a minimally viable way. Just for an example, would the method proposed in this comment be sufficient to get people using it, despite not being perfect? Would it be enough to gather a user base and have a clear understanding of interest level and possibly attracting the revenue or investment necessary to take it to the next level? By that point, would we have enough pull with either NetNutrition and/or MyFitnessPal to get greater access to their APIs in order to further enhance the connection process? Would either of those companies become interested in purchasing this minimally viable product as is and then make those additional enhancements themselves internally?

JDorpinghaus commented 8 years ago

Are you suggesting that college students would visit the new My Net Nutrition Pal (for lack of a better name) instead of NetNutrition in order to submit their foods to MyFitnessPal?

Yes - I think a completely separate webapp is necessary. This could be a full-blown website, or maybe a Chrome extension would be a better option. A Chrome extension would allow a user to navigate the existing NetNutrition interface, and maybe inject an HTML button 'Send to MyFitnessPal' in the page after the user has selected food items for their meal.

What do you think about the issues involved with (i.e. Marketing) to get this information in front of the students, especially when they're already familiar with NetNutrition?

Speaking from my experience at Mizzou, NetNutrition (aka ZouTrition at Mizzou) is surprisingly "hidden". I had no idea that it existed until a few weeks ago. I have never seen a piece of marketing or advertisement for the service, even in the sea of documents/pamphlets/brochures/emails I received as a new student. Maybe I just missed that section or something, I don't know. I specifically googled for Mizzou nutrition information and I was amazed when I stumbled upon this huge food/nutrition database. There is a separate dining services website that lists the day's menu choices but not nutritional information - I assume this pulls from the same data source that Zoutrition does. There is a link to Zoutrition on this site.

I haven't heard any other students talk about Zoutrition either, so based on the lack of promotion I would say that most Mizzou students are unaware that it exists, don't care that it exists, or both. Would students even care about a MyZoutritionPal? Maybe there wouldn't be a huge user base, but surely if Zoutrition continues to exist there must be some students using it that would be interested in MyZoutritionPal.

Do you think the school would market this new product in addition to / instead of NetNutrition?

That is a possibility. Maybe MyZoutritionPal would even increase awareness/use by making Zoutrition easier to integrate with MyFitnessPal, a service that students are more likely to already be using.

Current scenario: Student goes to cafeteria, buys a hamburger. Wants to enter that data into MyFitnessPal, goes to NetNutrition to look up the data, then manually enters that data into MyFitnessPal.

Proposed scenario: Student goes to cafeteria, buys a hamburger. Wants to enter data into MyFitnessPal, goes to My Net Nutrition Pal to look up the data, and presses the send to MyFitnessPal button. DONE! So much easier. This would work by MNNP having a copy of the NetNutrition database (per se) and a connection with the MyFitnessPal API.

This is a PERFECT description of what I'm thinking of, and how the process currently works. :)


In your last comment, you offered a resource for scraping data from MyFitnessPal. What data would you want / need to scrape from MyFitnessPal?

You're right, it's not necessary to scrape anything from MyFitnessPal. I had a couple of ideas for future features, like percentage of total daily calories/fat/whatever a food would add which would require some data from MyFitnessPal but nothing crucial to the basic functionality.

Would you agree that this is a very similar parallel?

Yep, sounds very similar, another really interesting problem! In this case, the "thing" isn't a food item, but a movie you haven't seen. Say, Mad Max: Fury Road, instead of a hamburger. You want to send the fact that you want to watch this movie to Netflix, instead of sending the fact that you ate this food to MyFitnessPal. Is there other data that you want to include when you send to Netflix (like Nutrition Facts to MFP), or is it just the fact that you want to watch this movie?

I'm thinking of something like IFTTT....

I've used ITTT breifly in the past but not too in-depth. Zapier seems really cool too - I found a Zap that integrates MapMyFitness (sister app to MyFitnessPal) with Google Sheets. It pulls data about your workout and puts it in a spreadsheet. I wonder if they are using an API for MMF?

Here's another approach...

This is definitely a possibility. I think there exists a better/easier/more convenient way to transfer the data between NetNutrition and our product - but OCR could be a quick and "dirty" way to get a functioning app and gain users/API accesss/attention as you said.

s1037989 commented 8 years ago

Terrific feedback, Jacob! This is an excellent dialog. As a side note, I wonder how superior it would be to move this to Slack? Clearly this comment thread could get quite unwieldy if we're not careful. You did a great job meticulously ensuring that you don't break the flow. But, with Slack, how can you brain dump 100 ideas as you have here? Man, it's a lose-lose. But I digress...

maybe a Chrome extension would be a better option

I don't think so... Especially for you college students. Do you even have a laptop or a desktop?? ;) Everything you young whipper-snappers do is on your mobile devices. And, at least currently AFAIK, Chrome extensions are not available for Chrome on mobile platforms.

... marketing ...

I'm glad I have you thinking about this now. But let's further that discussion elsewhere as it isn't pertinent to the discussion of solving the problem.

... move parallel ...

We should create another KIL Issue to talk about this. I can see this going a couple ways.

  1. Build MyZoutritionPal
  2. Build MyMoviePal (which benefits from a lot of the lessons learned from MyZoutritionPal)

. or .

  1. Build a My*Pal framework for solving the plethora of problems that suffer from the same base
    1. Build MyZoutritionPal based on this framework
    2. Build MyMoviePal based on this framework

To answer your question: the ultimate goal is just to rack-up a single movie to do list from many sources. Future features to do many additional things could certainly come later, but the primary purpose is to keep track of movies (easily) from many sources.

Currently, I have to login to Netflix and search for every movie that I discover in order to add it to a master list. It's really obnoxious to login to Netflix to add a movie when I'm already on Redbox.

Gosh, a Chrome extension would be fantastic. Every site that I visit that references movies could have an "Add to Netflix" button!

I wonder if they are using an API for MMF?

Surely!

... quick and "dirty" ...

PoCs (Proofs of Concept) have a lot of value. How popular is the idea really? Let's find out!

I'm not a marketing person, but I have a hard time believing that you can get accurate actual facts in regards to consumer desires when discussing a product that doesn't exist. I feel we need to have a POC to demonstrate and let people feel the value of the concept, on order to then really gauge demand.

s1037989 commented 8 years ago

Possible problem: often times EULAs specifically outlaw screen scraping.

What do you think about this? What I mean is -- and I'm not certain about the truth of this -- it may be against the law to create a website (MyZoutritionPal) which simply harvests the data of NetNutrition and makes it available to to users on a completely independent website.

Is this a problem? And if it is, what to do about it?

JDorpinghaus commented 8 years ago

Everything you young whipper-snappers do is on your mobile devices.

Great point, absolutely true! A mobile Chrome extension would be perfect... but that's not gonna be an option anytime soon.

EULA....

I looked at the copyright information for University of Missouri websites:

... none of this content may be copied, altered or distributed without the express written permission of the Curators of the University of Missouri.

To request permission to redistribute any material found on this website, please contact the UM System Web Coordinator...

It sounds like MyZoutritionPal would be allowed as long as we obtained explicit permission from the university. I've seen other official student-created programs (like a schedule planner) interact with UM data, so I assume they wouldn't have a problem with MZP using this publicly available data.

s1037989 commented 8 years ago

A mobile Chrome extension would be perfect... but that's not gonna be an option anytime soon.

Are you aware of this coming in the future? I've not heard of any plans to do so. I'm not sure why they wouldn't, I imagine it must be a technical (UI/UX) limitation...?


Does Chrome for Android support apps and extensions? Chrome apps and extensions are currently not supported on Chrome for Android. We have no plans to announce at this time.


It sounds like MyZoutritionPal would be allowed as long as we obtained explicit permission from the university.

Great! ZouTrition is really just NetNutrition, tho, right? So even if we had Mizzou's permission, would we have NetNutrition's permission?

I've seen other official student-created programs (like a schedule planner) interact with UM data, so I assume they wouldn't have a problem with MZP using this publicly available data.

I can totally believe that it would be pretty easy to get Mizzou's permission for what they are permitted to permit.

I further reckon that if the permission could be acquired, that raw access to the data could probably be acquired as well so that we needn't scrape.

s1037989 commented 8 years ago

I think we're ready for a next step:

  1. Contact Mizzou about permission to access Zoutrition data and even get raw access to the data?
  2. Build a prototype app that uses pseudo data; that is, for testing purposes, there would be a pile of sample food to select and random fake data would be returned. Hamburger: 3 calories, Salad 14,000g fat...

(2) could come first and it might be wise as it could help to persuade Mizzou to participate. However, it could be a wasted effort if Mizzou were unwilling or unable to.

So what do you think? Any other discussion points that you can see? Do you want to further pursue this? Do you want to contact Mizzou first or start a prototype first?

s1037989 commented 8 years ago

NetNutrition by CBORD

The good news is that the data is Mizzou's, not NetNutition's. So obtaining the data from Mizzou should be easier both technically and legally. They upload the data to NetNutrition, whether to the Cloud at CBORD, or to a locally hosted NetNutrition. Either way, the data upload process should be the same. Can we get them to upload the same data to us? I would love to get a sample of that data.

s1037989 commented 8 years ago

New question:

I just learned that anyone can upload anything to the MyFitnessPal database; and I found a bunch of Plaza 900 foods, e.g., in MyFitnessPal. So... those foods are already there, maybe not all of them.

In any case, it doesn't look like there needs to be an app, we just need to to take Mizzou's database and upload it to MyFitness Pal, maybe once per week or something... We could upload it in a very systematic way:

"Mizzou Plaza 900 Thin Crust Cheese Pizza" "Mizzou Plaza 900 Thin Crust Pepperoni Pizza" etc...

Did you want the app so that you have the ZouTrition browseable interface when it comes to finding your food, as opposed to searching among all the garbage that's in MyFitnessPal? Would it be better -- in fact even easier -- if there was a standard naming convention for your foods, as proposed above?

s1037989 commented 8 years ago

Check out this gist for some sample code, output, and comments.

JDorpinghaus commented 8 years ago

Contact Mizzou about permission to access Zoutrition data and even get raw access to the data.

I will work on this - I don't think Mizzou would have a problem allowing me to access this data, especially being a Computer Science student. I would like to have approval before starting any major work on the project.

NetNutrition by CBORD...

I will also try and find out exactly who/how the data is uploaded and see if it would be possible for us to have a copy as well. I assume you mean that they would upload the data to our own database?

I just learned that anyone can upload anything to the MyFitnessPal database; and I found a bunch of Plaza 900 foods...

Standard naming convention...

Awesome!! Yes, I do think a standard naming convention would be best. This should make it much easier to find Mizzou specific food items using MyFitnessPal's interface. I don't think a separate interface/app is necessary.

s1037989 commented 8 years ago

Awesome, man! This is an exciting project and we're really making progress on accomplishing something!

I assume you mean that they would upload the data to our own database?

Correct! Our project would be to build a web interface that would allow them to upload their data to our database and once the data is in our database, we can have whatever processes we want for managing the data and which items have already been uploaded to MyFitnessPal. You don't want to keep uploading Thin Crust Cheese Pizza every day!

Awesome!! Yes, I do think a standard naming convention would be best. This should make it much easier to find Mizzou specific food items using MyFitnessPal's interface. I don't think a separate interface/app is necessary.

Great! Looking forward to hearing what you have to report regarding your communication with Mizzou and then to getting started!!

My wife is a dietitian and she said that the dietitian students very likely are the ones that compile the information on the food and create the database, possibly even upload. You might want to contact the Dietitian wing of the school.

lizmayfield13 commented 8 years ago

I had an idea of something I would like to see in this area, but instead of a new thing, I think it could just be an add on to this. It's more of a fitness tracker helper, but normally they go hand in hand with diet and nutrition trackers.

When I'm at the gym it's a pain to try and catch the distance, calories, etc on the screen and get them input into the myfitnesspal app. Look away for a bit and the screen clears and you have to guess and manually punch in the numbers. Wouldn't it be cool if there was an app that let you just take a picture really quick and it scanned the photo for key words like "distance" or "calories" and input the numbers for you? Because I would use the crap out of it.

s1037989 commented 8 years ago

Hey, cool idea, Liz! I assume you're talking about less technologically advanced fitness equipment? A basic treadmill that just says you've burned 300 calories on a 3 mile walk...?

I just want to be clear about something tho... You seem to indicate that the information goes away pretty quickly, and you may miss it altogether when you turn away for a bit. How would a camera solve this?

As for just faster data entry, heck yeah!! A phone app with OCR would definitely solve that and make it easier. Nothing worse than the monotony of logging in to your app and poking in all your data every day... If you don't log your data, you didn't do the work out! But logging your data is worse than working out! What a predicament!

Yes, we need to solve this problem. I love the idea of solving this problem, generically, for all equipment. It sucks when new cool tools come out by require some ultra-modern technology for it to work. If I had ultra-modern equipment I wouldn't need your handy dandy cool tool!! Ugh.

Question: What if you had a fitbit? Would that solve your problem? Hands free, no user action required, easy, works on all equipment... What would be a disadvantage to using a fitbit? More costly than a "free" app? Maybe it wouldn't work on all equipment as I surmise? Perhaps it's not as accurate, especially on more exotic machines like those crazy stair climbing elliptical treadmills on a bowflexing leg press? Other reasons?

If a Fitbit would work, and if this app did exist, which would you choose to use and why?

s1037989 commented 8 years ago

Either way, Liz, I would suggest moving this to a new issue. While it is fitness based, I do think it different enough to warrant it's own issue and tracking process. If you wouldn't mind creating a new issue and posting and new comments in there, that'd be great!

You can copy and paste my comment and block-quote it by placing "> " at the beginning of the line.

Let me know if you have any questions about this.

JDorpinghaus commented 8 years ago

I have contacted several departments at Mizzou and am awaiting a response regarding the Zoutrition data.

s1037989 commented 8 years ago

On Thu, Feb 4, 2016 at 5:39 PM, Jacob Dorpinghaus notifications@github.com wrote:

I have contacted several departments at Mizzou and am awaiting a response regarding the Zoutrition data.

Awesome! Thanks for the update!

JDorpinghaus commented 8 years ago

Hi Jacob,

Thanks for the kind words regarding our Zoutrition product.

I appreciate your interest in working with us to expand the product into a connection with the MyFitnessPal app. We are currently doing some investigation on our end to see how this might work and what we would have to do to make this happen. I’m not sure, because I have not fully checked into it, but there may already be some linking to make this work that exists. About a year ago I was at a conference and people were talking about this, so today when I got your email, I did a quick google search on NetNutrition to myfitnesspal (NetNutrition is the vendors name for what Campus Dining has titled Zoutrition) and this search lead me to an article on the CBORD website (parent company for NetNutrition) https://www.cbord.com/enews/article.asp?articleid=1150. I have asked our departmental IT professional to review the data to see what might be involved on our part and to see if a link between the two systems has already been developed or if this is a viable project for your group.

I will let you know early next week, what I learn. Thanks again for your interest and I hope you have a terrific weekend.

s1037989 commented 8 years ago

Fantastic! This might turn out to be really easy...! ;)

JDorpinghaus commented 8 years ago

I received a response today with a sample CSV file of data exported from NetNutrition. This is perfect! It has all the nutrition data neatly organized. The sample file contains data from one of the smaller dining locations on campus. This file took 10 minutes to export from NetNutrition, so files from bigger locations with hundreds of food items will take a substantial amount of time to export. I also looked at the CBORD article.

NetNutrition can export your menus to a file that can then be uploaded to MyFitnessPal.

The article clearly explains how to export the data from NetNutrition, but I am still a little confused by the above statement. Now that we have the data in a CSV file, how do we get that data into MyFitnessPal? The article doesn't seem to address that. I tried to search for a 'bulk upload' feature or some other way to upload a CSV file to MFP but I could not find one.

s1037989 commented 8 years ago

The article clearly explains how to export the data from NetNutrition, but I am still a little confused by the above statement. Now that we have the data in a CSV file, how do we get that data into MyFitnessPal? The article doesn't seem to address that. I tried to search for a 'bulk upload' feature or some other way to upload a CSV file to MFP but I could not find one.

Fantastic! Likely you need to use their API.

So, at one point it sounded like they were going to be handling this, but that they sent you a CSV sample, are they interested in getting you involved?

s1037989 commented 8 years ago

Likely you need to use their API.

Check out this post from 9 days ago ("this is not an option at this time")!

One of the API options on the API request form is:

Post to MFP food database

So surely it's possible... You may not be able to bulk add, but you could as least create a script to post the food one at a time (not a huge deal). From a user's perspective, it's still bulk adding.

As a worst case option, it's theoretically possible to "web scrape" it as you talked about initially. Establish an authenticated session and then programmatically fill out the new food form, again and again and again.

JDorpinghaus commented 8 years ago

Check out this post from 9 days ago ("this is not an option at this time")!

Got it. The CBORD article made me think that there was a solution already available from MFP but obviously that is not the case.

"web scrape"

The MFP API is currently a private API available to approved developers only. I submitted a request for access when I posted the initial proposition for this issue but was denied ("We are currently only able to accept a very limited number of applicants"). I would definitely prefer to use the API over leveraging the food submission form but unfortunately it appears we are limited to that option. Do you think that is the direction we should go towards from here?

s1037989 commented 8 years ago

Got it. The CBORD article made me think that there was a solution already available from MFP but obviously that is not the case.

I could see that CBORD would have the necessary API built into their software that someone could do a bulk upload to MFP from CBORD software (such as NetNutrition).

From your conversations with MU, does it sound like MU's NetNutrition can bulk upload Foods to MFP? If so, what is the resistance? Is it MU's lack of time / expertise? Could you get involved with them and spearhead this operation?

Certainly, that only solves the problem for you and for MU, but you were looking at this as a much bigger picture, with a much bigger audience.

The MFP API is currently a private API available to approved developers only. I submitted a request for access when I posted the initial proposition for this issue but was denied ("We are currently only able to accept a very limited number of applicants"). I would definitely prefer to use the API over leveraging the food submission form but unfortunately it appears we are limited to that option. Do you think that is the direction we should go towards from here?

So I think I see 3 total possible options:

Do you see any other options? Do you agree that if (1) is true that it kills the idea from a product stand point, and simply just gives you a campus job? Do you think MFP can be pressured a little harder for the API? I'm sure they hardly reviewed your application and just sent you back a form letter. Perhaps some extra pressuring with perhaps a greater proposal submission might get them to think twice. I can understand that they are limiting API access, but if your sole purpose is to only send them data and possibly from every university in America, they might be wise to think again...!

s1037989 commented 8 years ago

To be clear about this issue, it's about populating MyFitnessPal with the data that exists in other sources, such as all of NetNutrition across all of its customers. That's a pretty massive database.

MyFitnessPal is a great and popular service. It just lacks a lot of data.

Action Items: