Hey guys....I did it again.... (aka More Greasemonkey fun)

Dragonwolf
Dragonwolf Posts: 5,600 Member
edited November 18 in Social Groups
I needed something to do while I was relaxing my back and digesting my dinner before attempting (again) to go to bed (angry back from gardening + 8:30pm meaty dinner + 11pm bedtime = miserable Dragon), so....I altered that keto userscript that calculates net carbs and gives you nifty charts.

I never really cared about the net carb calculation, but I liked the charts (well, at least the one that is a percentage of calories, I find the other one rather pointless, at least in its current state). So I've had it on my ToDo list to fork it (the term for what we developers do when we copy someone's code with the intent of altering it in some way; yes, this is legal, and it's common and encouraged practice in the open source community) and make the desired tweaks, but hadn't gotten around to do it.

Until tonight.

So, here you go, have another script from me: https://github.com/ShaunaGordon/mfp-keto-userscript

What I'll probably do on another sleepless night is include Steffanson's keto ratio (fat grams / (protein grams + carb grams) = ratio) and alter the right side pie chart to display based on that number (instead of fat to protein to carb ratio by grams, which just seems weird to me).

Also, if you guys have ideas for other stuff you'd like to see that aren't available, let me know and I'll add it to my list. Unfortunately, it seems the custom macro script is broken since the release of MFP premium. That's enforced by the server as I understand it. I might play around to see for sure if this is the case, but don't get your hopes up. Also, I can only manipulate what you see on the screen -- this means, for example, that I can't add extra columns in the diary for purposes of displaying more of the micronutrients, I can only calculate stuff based on the columns that are already there (such as the script this is based on, which requires the carbs and fiber columns to be displayed in order to calculate net carbs). If you're not sure, feel free to mention your idea, and I can let you know whether it's possible. :)

Additionally, I make no promises on timeframe. I do these on my spare time, which I don't have a ton of (especially considering the other projects I round-robin my way through), and some suggestions may be more involved or complicated than others, requiring more time/effort/concentration from me in order to achieve.

Again, and as usual, these scripts only work on browsers in which you have Tampermonkey (Chrome, maybe IE, maybe Opera) or Greasemonkey (Firefox) installed and have the script installed. There is no crossover with the mobile apps.

Replies

  • camtosh
    camtosh Posts: 898 Member
    edited May 2015
    Looks good, I think it installed okay (Windows Vista, chrome browser, Tampermonkey). Does this result look right? I can hardly see any blue for carbs in the pie charts, but the total says I am 24 grams over on carbs :) -- had a sushi lunch, so that is correct.

    uyr3zskn2yqg.jpg

    One thing I just noticed is that the protein % in green ink at the bottom of each meal is doubled. So that is maybe why the protein part of the pie chart is so large? You can see my diary if you click through on my name, it is public.
    1sv8fhp7dt7t.jpg
  • DonPendergraft
    DonPendergraft Posts: 520 Member
    OK, excuse me for being dense. But if net carbs are really what we need to be looking at it, why would we want to remove them from view? It would seem it would be better to remove the carb, and leave net carb. Or just display net carb and call it carb. What am I missing?

    I appreciate your hard work!
  • Dragonwolf
    Dragonwolf Posts: 5,600 Member
    camtosh wrote: »
    Looks good, I think it installed okay (Windows Vista, chrome browser, Tampermonkey). Does this result look right? I can hardly see any blue for carbs in the pie charts, but the total says I am 24 grams over on carbs :) -- had a sushi lunch, so that is correct.

    uyr3zskn2yqg.jpg

    One thing I just noticed is that the protein % in green ink at the bottom of each meal is doubled. So that is maybe why the protein part of the pie chart is so large? You can see my diary if you click through on my name, it is public.
    1sv8fhp7dt7t.jpg

    Uninstall the net carb one.
    OK, excuse me for being dense. But if net carbs are really what we need to be looking at it, why would we want to remove them from view? It would seem it would be better to remove the carb, and leave net carb. Or just display net carb and call it carb. What am I missing?

    I appreciate your hard work!

    Not everyone tracks or cares about net carbs. If you care about net carbs, then use the net carb one.
  • sweetteadrinker2
    sweetteadrinker2 Posts: 1,026 Member
    You are talented! Do you think a script could be written to enable us to have different goals on different days?
  • kirkor
    kirkor Posts: 2,530 Member
    You are talented! Do you think a script could be written to enable us to have different goals on different days?


    Oh baby, *fingers crossed* for this!!! (leangains.com fan here...........)
  • camtosh
    camtosh Posts: 898 Member
    edited May 2015
    Doh, thanks! I finally thought of that later on last night. Just turned off the old one and it looks fine now. Looking forward to seeing that keto ratio someday, too!
  • glossbones
    glossbones Posts: 1,064 Member
    Using Firefox (38.0.1) / Greasemonkey and I see no custom information on the food diary. I have disabled all other CSS and JS but no luck.
  • Dragonwolf
    Dragonwolf Posts: 5,600 Member
    kirkor wrote: »
    You are talented! Do you think a script could be written to enable us to have different goals on different days?


    Oh baby, *fingers crossed* for this!!! (leangains.com fan here...........)

    That would be pretty involved, especially since I don't think there's a way to do settings (which means I'd have to hardcode the numbers). I'll play around with it when I get some time and see what I can come up with.
    glossbones wrote: »
    Using Firefox (38.0.1) / Greasemonkey and I see no custom information on the food diary. I have disabled all other CSS and JS but no luck.

    It's sometimes finicky. Even the net carb one does that sometimes. If you open the developer console, there might be some error messages in there (open it, then refresh the page). If you can find them, post a screenshot or copy the message here and I might be able to help. Otherwise, I'll look into it when I get some time.
  • glossbones
    glossbones Posts: 1,064 Member
  • Dragonwolf
    Dragonwolf Posts: 5,600 Member
    edited May 2015
    Hrm, that's good to know, thanks for that!

    What version of Firefox and Greasemonkey are you running?
  • Dragonwolf
    Dragonwolf Posts: 5,600 Member
    glossbones wrote: »
    Ah, here you go:

    6snkbym1xdbe.png

    It should work now. Try it again.
  • glossbones
    glossbones Posts: 1,064 Member
    That did it! Thanks! :blush:
This discussion has been closed.