How to Track Weight Watchers Points on MFP!!

Options
12830323334

Replies

  • sharenalynette
    sharenalynette Posts: 1 Member
    Options
    I would love to know how to use with SmartPoints!
  • loseitin_2016
    loseitin_2016 Posts: 21 Member
    Options
    If you rejoin WW and do the Smart Points you also need the sugar grams to calculate the points.Anything with sugar or dairy has gone up in points.They are now urging more lean protein,fruits and veggies.
  • healthyjeneration
    Options
    No matter what I do, I can't get points to show up in MFP. I'm new to WW and have used MFP for a while. I installed tamper monkey, used the script you provided and tried changing the lines above. I enabled it and ran it, but nothing happened. What am I doing wrong?
  • Spidermurphy116
    Spidermurphy116 Posts: 8 Member
    Options
    Can anyone give me the script for the new WW Smart points?
  • Spidermurphy116
    Spidermurphy116 Posts: 8 Member
    Options
    If there is no script for the WW Smart points, can someone post the script for the old one. I set it up based on older posts and it isn't working.
  • gidget2208
    gidget2208 Posts: 2 Member
    Options
    msk3001 wrote: »

    Thank you msk3001!
    As you suggested, removing the forward slash / at the end of "diary" in the above 2 lines fixed the issue for me.

  • gidget2208
    gidget2208 Posts: 2 Member
    Options
    If anyone feels inclined to update the script with Smart Points, this blogger has done a LOT of the work on the new calculations.
    http://weightwatchergeek.blogspot.com.au/2015/12/a-comparison-of-weight-watchers-points.html

    All credit to Thomas Mills Hinkle
    https://plus.google.com/+ThomasMillsHinkle/posts
    From the website.
    *****************

    0.24*Sugar + 0.55*Saturated Fat + 0.27 * (Fat-Sat Fat) + 0.12 * (Carb - Sugar) + 0.024 * Protein + Alcohol * 0.18

    The following formula is, in my tests, slightly less accurate but perfectly serviceable:

    (0.0305 * calories) - (0.098*protein) + (0.12*sugar)+(0.275*sat fat)

    *******************

    MFP limits the number of nutrients being tracked on the website to 5 plus calories, so using the more complex and accurate calculation of 6 nutrients, as above, may not be helpful with the script.
    There is the simpler calculation but not as accurate.
  • jojo1371
    jojo1371 Posts: 33 Member
    Options
    Looking for an updated script with SmartPoints please.
  • msk3001
    msk3001 Posts: 11 Member
    Options
    gidget2208 wrote: »

    Thank you msk3001!
    As you suggested, removing the forward slash / at the end of "diary" in the above 2 lines fixed the issue for me.

    Yeah- I'm glad it worked for you :)
  • WifeOfTbone
    WifeOfTbone Posts: 6 Member
    Options
    Bump
  • smstuart33
    smstuart33 Posts: 3 Member
    Options
    hi, where are you seeing the points? I have added the script, with the mentioned adjustments in Tampermonkey and still do not see point on my fitness pal account.....

    can I add my scripting code in this text box, and can someone confirm that it is correct...not a programmer, just really want points to show... :'(
  • LeChuck71
    LeChuck71 Posts: 3 Member
    edited January 2016
    Options
    Hi,
    here is an updated version of the WW_MFP script - I just made some additions on "user friendly configuration" and the additional SP formula.
    All credits go to the original creators of this script

    Just go to GitHub with this link:
    github.com/LeChuck71/MFP_WW_Points
    • Click on the "MFP_WW_Points.user.js" file to show the script
    • On top of the script there should be a "RAW" button - click on it
    • Now Tmpermonkey should recognise a "userscript" and asks you to install it

    Thats it!
    In line 11 you can change the point calculation

    var usePointCalculation ="SmartPoints";

    Change to true to: original, PointsPlus, SmartPoints

    to change calculation formula

    Some comments on the usage:
    • For me it only works if I set my MFP language to "English" (I am original from Germany)
    • Also it just shows the points if your browser shows "http://www.myfitnesspal.com/food/diary/username" with username your name on MFP
    • If I click "Food Diary" the username ist missing sometimes, blame MFP for that, without the username it does not calculate the points.

    I am no expert in scripting or point calculation. I you discover any mistake please report it here or better on GitHub

    Cheers

    P.S.
    Tested on Google Chrome, Firefox with the additional Tapermonkey/Greasemonkey


  • smstuart33
    smstuart33 Posts: 3 Member
    Options
    Thanks so much for your help. I followed your steps, precisely and it still does not show...I am giving up..might have to purchase the WW etools after all... :'(
  • smstuart33
    smstuart33 Posts: 3 Member
    Options
    OMG!!!! Thankyou thankyou thankyou...the problem I was having was Tampermonkey was not enabled! I have Smart points!!!! for all those looking to get this follow zapod 71 instructions (page20) 1/27/2016

    Thanks again, !

    BTW, I did put my MFP username in address
  • LeChuck71
    LeChuck71 Posts: 3 Member
    Options
    Hey glad it works for you ;)

    If you can check the points calculation and give me some feedback would be great.
    I did it on some foods and recipes and it was fine compared to the original WW tool on an ipad.

    Cheers
  • Joleca
    Joleca Posts: 29 Member
    Options
    Zahpod71,

    Using Greasemonkey (Pale Moon / Firefox). I tried in Firefox since I didn't want to lose what I had in Pale Moon so far. Haven't been able to get this to work. I know for the older PP calculation you had to list tracking items in the setting as "Carbs, Fat, Fiber and Protein" for the calculation to work. I tried subbing in Sat Fat & Sugar and taking out the Carbs and Fat, but not working.. Also, do I need to change anything in the script to have it show SP's?

    Not very technical, so I'm sure I've put something in wrong.. Could use your help.

    Thanks,

    Joanna
  • LeChuck71
    LeChuck71 Posts: 3 Member
    Options
    Hi Joanna,

    I think for SP its Satureated Fat and sugar - but nur sure about it. If one is missing the calculation is not correct but should show up as a additional column.
    Make sure your browser end with your MFP "username" as mentioned in my post

    "http://www.myfitnesspal.com/food/diary/username" with username your name on MFP

    If thats not in it it will not show up in my browser as well.

    Try it and please report

    Cheers
    Axel
  • Joleca
    Joleca Posts: 29 Member
    Options
    Hi Axel,

    Loaded the new script, set the options for SP, (Calories, Saturated Fat, Sugar, Protein) and nothing.. not even seeing the Points column anymore. And yes, I did make sure my username was included in the URL. Under PP, the options were (Carbs, Fat, Fiber, Protein) and it showed the Points column.

    I have to be doing something wrong, but I don't know what.. Do I have to change anything in the script?
  • alloy1028
    alloy1028 Posts: 8 Member
    edited March 2016
    Options
    I tried the script posted on Github above, but many of the values (for non-fruit and vegetable foods) didn't match up with the current Weight Watchers website. I you want to use that one, you have to have sugar as your last nutrient dropdown.

    I tweaked the original script so that I could have another nutrient column of anything I wanted. (FYI I'm not a programmer, but I had fun fiddling around with it.) This worked on Chrome. The script is hard coded so that the different nutrients have to be in a specific order and the WW points come at the end after protein. BUT you can easily add one additional column between calories and carbs if you change the column numbers. This is still the older version of Weight Watchers points, so your fruits and veggies won't show up as 0 points. (I'm planning on just subtracting them in my head for now, but I'll ask my programmer husband if he can figure out a way to rewrite the script to make it actually work.) I also added the code that someone else mentioned to make it so that it works when you click on the diary button or switch to different days.

    Here are the steps to make it work:
    1) I went to the diary settings and changed the drop downs to the following order: Sugar (you can sub for whatever nutrient you want to track), Carbs, Fat, Fiber, Protein.
    2) Installed Tampermonkey, clicked on the new Tampermonkey symbol on my browser bar and went to Add New Script
    3) Erase everything in the box and paste in the code below and hit the save button. Refresh your diary and hopefully it should work for you.


    (function () {

    // ==UserScript==
    // @name MyFitnessPal Weight Watchers Points
    // @version 1.1.4
    // @description Adds display of Weightwatcher points to any daily food diary page. Also adds "Real Calories" calcalation based off 4/4/9 algorithm.
    // @include http://www.myfitnesspal.com/food/diary/*
    // @include https://www.myfitnesspal.com/food/diary/*
    // @include http://www.myfitnesspal.com/food/diary?*
    // @include http://www.myfitnesspal.com/food/diary

    // ==/UserScript==


    var pointsPlus=true;
    var precisonWW=true;

    if (window.top !== window.self) {
    return; /* do not run in frames */
    }

    if (typeof unsafeWindow != 'undefined')
    {
    (function page_scope_runner() {
    // If we're _not_ already running in the page, grab the full source
    // of this script.
    var my_src = "(" + page_scope_runner.caller.toString() + ")();";

    // Create a script node holding this script, plus a marker that lets us
    // know we are running in the page scope (not the Greasemonkey sandbox).
    // Note that we are intentionally *not* scope-wrapping here.
    var script = document.createElement('script');
    script.setAttribute("type", "application/javascript");
    script.textContent = my_src;
    document.body.appendChild(script);
    })();

    return;
    }

    function startRun() {
    var script = document.createElement("script");
    script.setAttribute("src", "http://www.google.com/jsapi");
    script.addEventListener('load', function() {
    loadscripts_1();
    }, false);
    document.body.appendChild(script);
    }

    var points, totalPoints=0;
    function getPointOld(cal1, fat1, fiber1, carbs, protein)
    {
    points=0;
    if (fiber1>4 && !pointsPlus)
    fiber1=4;
    points = cal1/50;
    points += fat1/12;
    points -= fiber1/5;
    if (pointsPlus)
    points = (protein / 10.94) + (carbs / 9.17) + (fat1/3.89)- (fiber1 / 12.49);
    //alert(points);
    if (precisonWW)
    {
    points=Math.round(points)
    }
    else
    {
    var intPoints = Math.floor(points);
    fraction = points - intPoints;
    if (fraction<0.25)
    points = intPoints + 0.0;
    else if (fraction>=0.25 && fraction<0.75)
    points = intPoints +0.5;
    else
    points = intPoints+1;
    }
    }

    function main()
    {
    //$("tr:first").append('<col class="col-2" />');
    $("tr:first").append('<th >');
    $("tr:not(:first)").append("<td>");

    var found=false;
    var totalFound=false;
    var table1 = jQuery('.table0');
    var totalPoints=0;
    //alert($(table1[12]).text());
    var rowInd=-1;
    table1.find('tr').each(function()
    {
    rowInd++;
    var index=0;
    found=false;
    if ($(this).hasClass('meal_header') && rowInd==0)
    $(this).append('<td class="alt">Weight Watcher Points+</td>');
    if (!totalFound && $(this).hasClass('total'))
    {
    totalFound=true;
    $(this).find('td').eq(7).html(totalPoints);
    }
    var cols=$(this).find('td').each(function()
    {
    if (index==0)
    ;
    else if (index==1)
    {
    cal11=($(this).text());
    }
    else if (index==2)
    carbs=($(this).text());
    else if (index==3)
    fat11=$(this).text();
    else if (index==4)
    fiber11=$(this).text();
    else if (index==5)
    protein=($(this).text());
    else if (index==6 && $(this).hasClass('delete'))
    {
    found=true;
    getPointOld(cal11, fat11, fiber11, carbs, protein);
    totalPoints+=points;
    //$(this).append(points);
    }
    else
    {
    if (found)
    $(this).append(points);
    /*if (totalFound)
    {
    totalFound=false;
    $(this).append('<td/><td/><td/>'+totalPoints);
    }*/
    }
    index +=1;
    }
    );
    });
    }

    function loadscripts_1()
    {
    var script = document.createElement("script");
    script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js");
    script.addEventListener('load', function() {
    loadscripts_2();
    }, false);
    document.body.appendChild(script);
    }

    function loadscripts_2()
    {
    jQuery.noConflict();

    /* fix for old prototype conflict with google viz api */
    /* retrieves the Array reduce native function using cleverness */
    var ifr = document.createElement('iframe');
    document.body.appendChild(ifr);
    Array.prototype.reduce = ifr.contentWindow.Array.prototype.reduce;
    document.body.removeChild(ifr);

    google.load( "visualization", "1", {packages:["corechart"],"callback":main} );
    }



    startRun();
    })();

  • alloy1028
    alloy1028 Posts: 8 Member
    Options
    Sorry, I posted the old version and it won't let me edit or delete the post. Here is the correct version: (function () {

    // ==UserScript==
    // @name MyFitnessPal Weight Watchers Points
    // @version 1.1.4
    // @description Adds display of Weightwatcher points to any daily food diary page. Also adds "Real Calories" calcalation based off 4/4/9 algorithm.
    // @include http://www.myfitnesspal.com/food/diary/*
    // @include https://www.myfitnesspal.com/food/diary/*
    // @include http://www.myfitnesspal.com/food/diary?*
    // @include http://www.myfitnesspal.com/food/diary

    // ==/UserScript==


    var pointsPlus=true;
    var precisonWW=true;

    if (window.top !== window.self) {
    return; /* do not run in frames */
    }

    if (typeof unsafeWindow != 'undefined')
    {
    (function page_scope_runner() {
    // If we're _not_ already running in the page, grab the full source
    // of this script.
    var my_src = "(" + page_scope_runner.caller.toString() + ")();";

    // Create a script node holding this script, plus a marker that lets us
    // know we are running in the page scope (not the Greasemonkey sandbox).
    // Note that we are intentionally *not* scope-wrapping here.
    var script = document.createElement('script');
    script.setAttribute("type", "application/javascript");
    script.textContent = my_src;
    document.body.appendChild(script);
    })();

    return;
    }

    function startRun() {
    var script = document.createElement("script");
    script.setAttribute("src", "http://www.google.com/jsapi");
    script.addEventListener('load', function() {
    loadscripts_1();
    }, false);
    document.body.appendChild(script);
    }

    var points, totalPoints=0;
    function getPointOld(cal1, fat1, fiber1, carbs, protein)
    {
    points=0;
    if (fiber1>4 && !pointsPlus)
    fiber1=4;
    points = cal1/50;
    points += fat1/12;
    points -= fiber1/5;
    if (pointsPlus)
    points = (protein / 10.94) + (carbs / 9.17) + (fat1/3.89)- (fiber1 / 12.49);
    //alert(points);
    if (precisonWW)
    {
    points=Math.round(points)
    }
    else
    {
    var intPoints = Math.floor(points);
    fraction = points - intPoints;
    if (fraction<0.25)
    points = intPoints + 0.0;
    else if (fraction>=0.25 && fraction<0.75)
    points = intPoints +0.5;
    else
    points = intPoints+1;
    }
    }

    function main()
    {
    //$("tr:first").append('<col class="col-2" />');
    $("tr:first").append('<th >');
    $("tr:not(:first)").append("<td>");

    var found=false;
    var totalFound=false;
    var table1 = jQuery('.table0');
    var totalPoints=0;
    //alert($(table1[12]).text());
    var rowInd=-1;
    table1.find('tr').each(function()
    {
    rowInd++;
    var index=0;
    found=false;
    if ($(this).hasClass('meal_header') && rowInd==0)
    $(this).append('<td class="alt">Weight Watcher Points+</td>');
    if (!totalFound && $(this).hasClass('total'))
    {
    totalFound=true;
    $(this).find('td').eq(8).html(totalPoints);
    }
    var cols=$(this).find('td').each(function()
    {
    if (index==0)
    ;
    else if (index==2)
    {
    cal11=($(this).text());
    }
    else if (index==3)
    carbs=($(this).text());
    else if (index==4)
    fat11=$(this).text();
    else if (index==5)
    fiber11=$(this).text();
    else if (index==6)
    protein=($(this).text());
    else if (index==7 && $(this).hasClass('delete'))
    {
    found=true;
    getPointOld(cal11, fat11, fiber11, carbs, protein);
    totalPoints+=points;
    //$(this).append(points);
    }
    else
    {
    if (found)
    $(this).append(points);
    /*if (totalFound)
    {
    totalFound=false;
    $(this).append('<td/><td/><td/>'+totalPoints);
    }*/
    }
    index +=1;
    }
    );
    });
    }

    function loadscripts_1()
    {
    var script = document.createElement("script");
    script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js");
    script.addEventListener('load', function() {
    loadscripts_2();
    }, false);
    document.body.appendChild(script);
    }

    function loadscripts_2()
    {
    jQuery.noConflict();

    /* fix for old prototype conflict with google viz api */
    /* retrieves the Array reduce native function using cleverness */
    var ifr = document.createElement('iframe');
    document.body.appendChild(ifr);
    Array.prototype.reduce = ifr.contentWindow.Array.prototype.reduce;
    document.body.removeChild(ifr);

    google.load( "visualization", "1", {packages:["corechart"],"callback":main} );
    }



    startRun();
    })();