How to Track Weight Watchers Points on MFP!!
Replies
-
@alloy1028 Thank you for the script. It works great, except it doesn't seem to get all the points quite right.
I was trying to figure out the formula that you were using and couldn't.
The formula that I've found on another web site is (calories + 4xSugar + 9xSat.Fat - 3.2xProtein)/330 -
Cool, cant' wait until this afternoon to try to do this. Thank you.0
-
I can't get the points to display in my diary what am I doing wrong?0
-
Worked perfectly - thank you!0
-
Thank you to so many of you for your help. This used to work on Firefox, then didn't, then did occasionally. Now after tweaking line 5 and 6 of the script and removing the / - it works!1
-
I tried Zaphod71's github script for Smart Points. I had to remove the final / from lines 6 & 7 as someone suggested, but now it works fine. . . Except that the calculations are way off. For example WW says a Haas Avocado is 7 points, but the script says it's 17.5!
Right now I have my nutrients set in this order: Saturated Fat, Protein, Fat, Sugar, None.
Any suggestions?0 -
Has anyone been able to update the WW pts to the new "New Smart Points"?0
-
midsummer174627 wrote: »I tried Zaphod71's github script for Smart Points. I had to remove the final / from lines 6 & 7 as someone suggested, but now it works fine. . . Except that the calculations are way off. For example WW says a Haas Avocado is 7 points, but the script says it's 17.5!
Right now I have my nutrients set in this order: Saturated Fat, Protein, Fat, Sugar, None.
Any suggestions?
How about furnishing the script or a link to it? Thanks0 -
I do mfp on my phone. But covert to points with the sp calculator. I count all foods, nothing free.0
-
Does anyone know of a script for WW Fit Points??0
-
This has worked for me for a few weeks and is all of a sudden only showing 0 points for everything. Anyone else experiencing this?
Here's the link to the script I'm using: https://github.com/LeChuck71/MFP_WW_Points/raw/master/MFP_WW_Points.user.js0 -
I just installed the script and running into the same issue as mboushey - the column is there but it is only showing 0 points for everything.0
-
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
I followed the instructions and the column displays, but everything just calculates to 0. Any idea what I am doing wrong?1 -
is this link still working for anyone.1
-
Nto working for me anymore. It's just calculating the points to zero now. @alloy1028 or @Zahpod71 any suggestions? Thank you in advance!0
-
Really not many calories in veggie's but In fruit yes because of the sugar, the only way you could have a lot of calories in veggies is if one loads them with butter and such, and also consuming veggies by the time one digest's them they become water---that's the reason WW makes them free points.0
-
heathercaldwell75 wrote: »Nto working for me anymore. It's just calculating the points to zero now. @alloy1028 or @Zahpod71 any suggestions? Thank you in advance!
Not just me then0 -
Mine are all registering as zero now as well.0
-
MFP changed it's column names so the script is a little wonky. I tried to submit a pull request to LeChuck71's script, but it looks like it's a read only repository. So here is the updated script that fixes that.
All credit obviously goes to LeChuck71 & the original poster
(function () {
// ==UserScript==
// @name MyFitnessPal Weight Watchers Points
// @version 1.3
// @description Adds display of Weight Watcher points to any daily food diary page. Also adds "Real Calories" calculation based off 4/4/9 algorithm.
// @include http://www.myfitnesspal.com/food/diary/*
// @include https://www.myfitnesspal.com/food/diary/*
// ==/UserScript==
// Originally from: http://userscripts-mirror.org/scripts/show/122949
var usePointCalculation ="SmartPoints"; //Change to true to:
// original
// PointsPlus
// SmartPoints !make sure "Saturated Fat" ist listet in your MFP diary!
// to change calculation formula
var precisonWW = false; //Change to true for true fractional point values (instead of just .25, .50, and .75)
var totalPoints = 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);
}
function getPointOld(calories, fat, fiber, carbs, protein, sugar)
{
var points = 0;
switch (usePointCalculation) {
case "original":
if (fiber > 4 ) {
fiber = 4;
}
points = (calories / 50) + (fat / 12) - (fiber / 5);
break;
case "PointsPlus":
points = (protein / 10.94) + (carbs / 9.17) + (fat / 3.89) - (fiber / 12.49);
break;
case "SmartPoints":
points = (calories*0.0303) + (sugar*0.1212) + (fat*0.2727) - (protein*0.0970);
break;
}
//alert(points);
if (precisonWW)
{
points = Math.round(points);
}
else
{
var intPoints = Math.floor(points);
fraction = points - intPoints;
if (fraction < 0.25)
points = intPoints + 0;
else if (fraction >= 0.25 && fraction < 0.75)
points = intPoints + 0.5;
else
points = intPoints + 1;
}
return points;
}
function main()
{
$('tr:first').append('<th >');
$('tr:not(:first)').append('<td>');
var totalFound = false;
var diaryTable$ = $('.table0');
var totalPoints = 0;
var columnIndexMap = {
calories: -1,
carbs: -1,
fat: -1,
fiber: -1,
protein: -1,
sugar: -1,
remove: -1
};
//alert($(diaryTable$[12]).text());
diaryTable$.find('tr').each(function (rowInd)
{
if (rowInd === 0 && $(this).hasClass('meal_header')) {
$(this).append('<td class="alt">' + usePointCalculation +'</td>');
columnIndexMap = BuildColumnIndexMap($(this));
}
if (!totalFound && $(this).hasClass('total'))
{
totalFound = true;
$(this).find('td').eq(columnIndexMap.remove).html(totalPoints);
}
var fiber = 0;
var calories = 0;
var carbs = 0;
var fat = 0;
var protein = 0;
var sugar = 0;
var cols = $(this).find('td').each(function (column)
{
var value = GetNumberFromCell($(this));
console.log(value);
switch (column) {
case columnIndexMap.calories:
calories = value;
break;
case columnIndexMap.carbs:
carbs = value;
break;
case columnIndexMap.fat:
fat = value;
break;
case columnIndexMap.fiber:
fiber = value;
break;
case columnIndexMap.protein:
protein = value;
break;
case columnIndexMap.sugar:
sugar = value;
break;
case columnIndexMap.remove-1:
if ($(this).hasClass('delete')) {
var points = getPointOld(calories, fat, fiber, carbs, protein, sugar);
totalPoints += points;
$(this).next().append(points);
}
break;
}
});
});
}
function BuildColumnIndexMap(row$) {
var columnIndexMap = {
calories: -1,
carbs: -1,
fat: -1,
fiber: -1,
protein: -1,
remove: -1
};
row$.find('td').each(function (index) {
var text = $(this).text();
if (text.indexOf("Calories") != -1)
{
columnIndexMap.calories = index;
}
else if (text.indexOf("Carbs") != -1)
{
columnIndexMap.carbs = index;
}
else if (text.indexOf("Fat") != -1)
{
columnIndexMap.fat = index;
}
else if (text.indexOf("Fiber") != -1)
{
columnIndexMap.fiber = index;
}
else if (text.indexOf("Protein") != -1)
{
columnIndexMap.protein = index;
}
else if (text.indexOf("Sugar") != -1)
{
columnIndexMap.sugar = index;
}
});
columnIndexMap.remove = row$.find('td').length;
return columnIndexMap;
}
function GetNumberFromCell(cell) {
return parseInt(cell.text().replace(',', ''), 10);
}
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();
})();
3 -
MFP changed it's column names so the script is a little wonky. I tried to submit a pull request to LeChuck71's script, but it looks like it's a read only repository. So here is the updated script that fixes that.
All credit obviously goes to LeChuck71 & the original poster
Thank you!! The revised script fixed it. Nerd question, but how did you figure out the new column names?
0 -
How do I install the script above, and what should I put in MFP for the display (columns and order). Thanks!!!
0 -
awesome that you have been able to update the script however I am still seeing zero's in my smart points column....help
0 -
I have tried everything. I see the box smart points but its still zero
0 -
I've got the script working enough to give me the Smart Points column, but nothing registers any points. everything shows up as 0. Any thoughts on that?
Thanks!0 -
Save0
-
I got it to work tonight sooooo happy.. copied the script above from Tineyd00 and it works!0
-
Hi All,
Trying to do this now, in 2017. When I click on the link for the Greasemonkey install above, I get the message that the install was successful, then...nothing. Literally, the web address says <about:blank> I have the script info, I have Greasemonkey installed, and am using Firefox. But...I am not a computer-knowledgeable person. Any ideas to help me move along?
Thanks.0 -
Finally got to work in Tampermonkey on my Android tablet using Chrome. Copied script above (Tinyd00), pasted into Tampermonkey and used carbs, saturated fat, fiber, protein for column heads0
-
Any help for Mac users, please?0
-
Hello all! I've installed Greasemonkey on Firefox, and tried Tinyd00's script, copied and pasted from above, thank you! At first it showed a SmartPoints column to the right of Calories Carbs Fat Fiber Protein. If I enter an item in my food diary it does indeed show up as Points!
However, I've realized that since I am currently enrolled in Weight Watchers, what I really want is to enter Points in WW online, and have it enter the calories into MFP!1
Categories
- All Categories
- 1.4M Health, Wellness and Goals
- 393.4K Introduce Yourself
- 43.8K Getting Started
- 260.2K Health and Weight Loss
- 175.9K Food and Nutrition
- 47.4K Recipes
- 232.5K Fitness and Exercise
- 426 Sleep, Mindfulness and Overall Wellness
- 6.5K Goal: Maintaining Weight
- 8.5K Goal: Gaining Weight and Body Building
- 153K Motivation and Support
- 8K Challenges
- 1.3K Debate Club
- 96.3K Chit-Chat
- 2.5K Fun and Games
- 3.7K MyFitnessPal Information
- 24 News and Announcements
- 1.1K Feature Suggestions and Ideas
- 2.6K MyFitnessPal Tech Support Questions