Reply
 
Thread Tools
Old 06-04-2014, 02:31 PM   #16  
Member
Thread Starter
 
Aldergrove BC's Avatar
 
Join Date: Nov 2011
Location: Aldergrove, BC
Posts: 99

S/C/G: 135/133/115

Height: 5'2"

Default

Oh ya, I see that now. That was copied and pasted from somewhere else.
I will go and edit it so people know

Last edited by Aldergrove BC; 06-04-2014 at 02:33 PM.
Aldergrove BC is offline   Reply With Quote
Old 06-04-2014, 03:19 PM   #17  
Less of a Better Me
 
Koshka's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 1,412

Default

BTW, my DH uses Chrome and we went and found the Chrome instructions on MFP and he uses tampermonkey as the add on and he did the following to make it work in Chrome (in addition to the other stuff mentioned):

add this to the top of the script file:
(function () {

and then this to the very bottom of the script:
})();
Koshka is offline   Reply With Quote
Old 06-04-2014, 06:05 PM   #18  
Member
Thread Starter
 
Aldergrove BC's Avatar
 
Join Date: Nov 2011
Location: Aldergrove, BC
Posts: 99

S/C/G: 135/133/115

Height: 5'2"

Default

Oh thank you! I prefer Chrome
Aldergrove BC is offline   Reply With Quote
Old 06-05-2014, 08:26 AM   #19  
Up and at 'em...again!
 
Snoofie's Avatar
 
Join Date: Mar 2011
Location: Smack dab in the middle, Newfoundland, Canada
Posts: 668

S/C/G: 203.4/170.4/140.0

Height: 5'0"

Default

Oh thank god. I really don't like using Firefox (I've gotten used to using Chrome.)
Snoofie is offline   Reply With Quote
Old 06-05-2014, 10:01 PM   #20  
Senior Member
 
Michelle125's Avatar
 
Join Date: Feb 2008
Location: Philly burbs
Posts: 493

S/C/G: 245/ticker/125

Height: 5'5''

Default

are there detailed instructions for doing this in chrome with tampermonkey?
Michelle125 is offline   Reply With Quote
Old 06-06-2014, 01:54 AM   #21  
Less of a Better Me
 
Koshka's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 1,412

Default

I used the ones I posted and that was enough. There are some threads on MFP though so maybe some have more.

But really all you have to do is install Tampermonkey then edit the script as I posted. Also change lines 10 and 11 of the original script to true.
Koshka is offline   Reply With Quote
Old 06-06-2014, 01:30 PM   #22  
Member
Thread Starter
 
Aldergrove BC's Avatar
 
Join Date: Nov 2011
Location: Aldergrove, BC
Posts: 99

S/C/G: 135/133/115

Height: 5'2"

Default

When I go to that same userscript I posted now, it takes me to a page that says Web application could not be started -
http://userscripts.org:8080/scripts/show/122949

I posted in MFP asking if someone who's better with computers than I knew what was going on with the user script but no answers yet. Weird, since it worked just fine the other day.
Aldergrove BC is offline   Reply With Quote
Old 06-06-2014, 01:44 PM   #23  
Senior Member
 
Michelle125's Avatar
 
Join Date: Feb 2008
Location: Philly burbs
Posts: 493

S/C/G: 245/ticker/125

Height: 5'5''

Default

@Aldergrove- that's the same problem I was having! Thanks for posting to MFP
Michelle125 is offline   Reply With Quote
Old 06-08-2014, 02:47 PM   #24  
Senior Member
 
Michelle125's Avatar
 
Join Date: Feb 2008
Location: Philly burbs
Posts: 493

S/C/G: 245/ticker/125

Height: 5'5''

Default

got it to work, here's the whole thing which WAS NOT coming up for me before. Someone had to post this in the MFP forum.

(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/*
// ==/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();
})();
Michelle125 is offline   Reply With Quote
Old 06-24-2014, 12:10 PM   #25  
Junior Member
 
stratcat45's Avatar
 
Join Date: Feb 2009
Location: Pennsylvania
Posts: 24

S/C/G: 184.4/169.2/140

Height: 5'3"

Default

I use this at My Fitness Pal as well, to give my fruits 0 pts. I just add my own and give 0 amounts to everything. I use a phone app called WWdiary for my android. It's free and I really like it - you do need to know the program though. If you pay $1.00 month thru paypal; you can use the scanner portion with it and I really like that!
stratcat45 is offline   Reply With Quote
Old 01-27-2015, 02:34 PM   #26  
Junior Member
 
Hooper's Avatar
 
Join Date: Jan 2015
Posts: 1

Default

Does this still work? I am unable to make it work. Thanks
Hooper is offline   Reply With Quote
Old 01-29-2015, 12:08 AM   #27  
Less of a Better Me
 
Koshka's Avatar
 
Join Date: Nov 2010
Location: Texas
Posts: 1,412

Default

Works fine for me. What browser are you using? (I'm using Firefox).
Koshka is offline   Reply With Quote
Old 04-06-2018, 11:50 PM   #28  
Junior Member
 
Kalisa's Avatar
 
Join Date: Apr 2011
Location: Aptos, California
Posts: 27

S/C/G: 221.2/207.7/130

Height: 5' 3.73"

Default

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:
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 Smart 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!

Last edited by Kalisa; 04-06-2018 at 11:53 PM.
Kalisa is offline   Reply With Quote
Old 07-07-2018, 09:26 AM   #29  
Junior Member
 
just_keep_swimming's Avatar
 
Join Date: Mar 2018
Location: Louisiana
Posts: 13

S/C/G: 244/237.6/160

Height: 5'5"

Default

There's an Android app that you can use to follow WW without a subscription. It's called Ultimate Food Value Diary and it's very cheap. It has the new plan too!
just_keep_swimming is offline   Reply With Quote
Old 07-07-2018, 10:43 AM   #30  
Junior Member
 
Kalisa's Avatar
 
Join Date: Apr 2011
Location: Aptos, California
Posts: 27

S/C/G: 221.2/207.7/130

Height: 5' 3.73"

Smile Good tip!

Quote:
Originally Posted by just_keep_swimming View Post
There's an Android app that you can use to follow WW without a subscription. It's called Ultimate Food Value Diary and it's very cheap. It has the new plan too!
Thank you for this info!
Kalisa is offline   Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 03:59 AM.


We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.