How to Track Weight Watchers Points on MFP!!

Options
12829303133

Replies

  • BJNPNG
    BJNPNG Posts: 1 Member
    Options
    I got smart points to work by ordering columns this way - after calories: sugar, sat fat, protein. 4th column doesn't matter. In the script those three columns are in the Smart Points formula, not carbs, fiber and total fat like the Points Plus used. When I had the Points Plus columns showing I was getting an egg counting for 3 points , etc., as others have said. Now it works fine. I am using FireFox for MFP only. Usually use Chrome but couldn't get the script to work there.
  • cutesized
    cutesized Posts: 7 Member
    Options
    I have this working as far as showing a column, but it just shows a 0 in the points column.

    svz4y8nymxt6.png
  • cutesized
    cutesized Posts: 7 Member
    Options
    cutesized wrote: »
    I have this working as far as showing a column, but it just shows a 0 in the points column.

    Oh, never mind, I copied the updated script and it works perfectly now. Thank you!
  • Joleca
    Joleca Posts: 29 Member
    Options
    Copied the script from above, pasted, saved, enabled.. Still NO SmartPoints column.. What am I doing wrong??? Thanks.
  • lcp5
    lcp5 Posts: 1 Member
    Options
    I have this working in both Chrome and Opera. I installed TamperMonkey, then copied the script (which is available several pages back), and saved it. At first, no points column appeared. I had to open TamperMonkey, click to edit the script (which is called "MyFitnessPal Weight Watchers Points"), and then click the "Settings" tab. Under "User includes" I added "http://www.myfitnesspal.com/food/diary". For some reason, adding the URL without the slash at the end got everything working for me.
  • TopoliT
    TopoliT Posts: 11 Member
    Options
    Hello! After searching around for quite awhile, I got this to work on my HP laptop on Firefox. I have my columns set in this order: Carbs, Sat Fat, Fiber, Protein. I used this code:
    // ==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/*
    // ==/UserScript==


    var pointsPlus=true;
    var precisonWW=0;

    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">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();

    The count doesn't exactly match what I tally up in WW, but it is close. For example, it still counts WW Freestyle "Free" items like a boiled egg and fruit, but that is easy to just mentally delete from the final WW Points count. It does count half-Points, which I like. It also under-counted the Trader Joe's Dark Chocolate Peanut Butter Cups I indulged in, which is also fine with me, since I find that WW incriminates us for unwise food items, which can be discouraging.

    Please let me know if this helps! :)
  • amwelsh1978
    amwelsh1978 Posts: 2 Member
    Options
    Does this still work since the Weight Watchers changes? I have tried it in both Firefox and Chrome. I would appreciate it if someone could give me step by step instructions as I'm afraid it is all a bit too technical for me! :)
  • amwelsh1978
    amwelsh1978 Posts: 2 Member
    Options
    bump
    I don't mind which version of WW it uses - I've done them all over the years :#
  • margiemena
    margiemena Posts: 2 Member
    Options
    will this work on an iphone?
  • margiemena
    margiemena Posts: 2 Member
    Options
    bump
  • keengkong
    keengkong Posts: 83 Member
    Options
    Does this still work since the Weight Watchers changes? I have tried it in both Firefox and Chrome. I would appreciate it if someone could give me step by step instructions as I'm afraid it is all a bit too technical for me! :)

    I also would love step by step instructions. Weight Watchers is the program I'm following. But I'd like to at least be able to keep an eye on the calories.
  • eldarkera
    eldarkera Posts: 1 Member
    Options
    I've tried all of the suggestions here on both Firefox and Chrome but to no avail. Unfortunately, the points column doesn't show up. Is it a Mac OS issue perhaps? Any advice would be great.

    I have used the most recently updated code.
  • LeanneCutrara
    LeanneCutrara Posts: 31 Member
    Options
    Has anyone have the script working for the new freestyle?
  • LeanneCutrara
    LeanneCutrara Posts: 31 Member
    Options
    I can't get any column to show up anymore? :(
  • marellasorella6878
    marellasorella6878 Posts: 1 Member
    Options
    does this work on mobile
  • mafh01
    mafh01 Posts: 1 Member
    Options
    I can't get this to work on Mac OS -- have tried both the Firefox and Google Chrome versions. Have tried changing the include statement to use the url without the trailing slash, but nothing works. Does it still work for anyone else on a Mac?
  • Bnabum
    Bnabum Posts: 2 Member
    Options
    From what I can tell, the code is for Points Plus. The original code was created in 2012. Any programmers out there that can modify the code to current Freestyle points?
  • Diatonic12
    Diatonic12 Posts: 32,344 Member
    edited July 2018
    Options
    Combining all kinds of protocols is overthinking it. The premise of ww is counting their points and doing it their way. This way usually changes every year or so to keep you on your toes and it's good marketing strategy. Throw everything out with the bath water, clean the slate and clear the decks...time to buy all of the new material.

    Simply track your data points here. It's not complicated and it's straightforward. There's no wiggle room. You track every portion and item. There's really no such thing as a free lunch. Freewheeling it. If that really worked there would be no such thing as repeat customers for weight loss. Ever.

    You would freestyle and freewheel, free lunch it. You would conduct one diet, one time and be fixed for the rest of your life. No rebound weight gain with friends. Fixed.

    But until someone can prove that actually works, from the top of the head, top head to the bottom of the food chain, you can moderate yourself and food by simply tracking your data points every day. And you can do it on your own terms while eating the foods you enjoy.
  • LeanneCutrara
    LeanneCutrara Posts: 31 Member
    Options
    Any updates?
  • awolf2011
    awolf2011 Posts: 265 Member
    Options
    I did not know that this could be possible and I would like to find out as well if there is an update to this. I am using WW because for me the points was easier than just using MFP. I like to track both to be sure that I'm consuming enough calories since there are so many foods that are 0 pts on WW.