Re:Live Presidential Forecast
by susw on Tuesday November 08, 2016 @08:52PM
(#12905515)
Disable jitter by running the following in console:
[ Parent
| on HN ]
Re:Live Presidential Forecast
by farnsworth on Tuesday November 08, 2016 @09:28PM
(#12905655)
Increase the jitter amount with the following:
require('forecast/jitter').get = function(){return Math.random()*10;}Election Time!
require('forecast/jitter').get = function(){return new Date().getSeconds()-30;}Haha, awesome find.
Did you just dig through the code or are you a NYT dev?
Dug through the code. Just inspected the element showing the number to get the class (.widget-info-display-cont) and searched through 'general-main.js' to find where the element is created. A timer that updates the value in the element is found ~100 lines further down.
Re:Live Presidential Forecast
by spacehacker on Tuesday November 08, 2016 @09:42PM
(#12905718)
What does the require statement do?
That's how they load the module that does the jittering. So by assigning its .get() method to be a noop instead (return 0), it does nothing (besides pointlessly return zero) when attempting to load.