Skip to content

Instantly share code, notes, and snippets.

View kevko's full-sized avatar

Kevin Koehler kevko

  • Automattic
  • Washington, DC
View GitHub Profile
@carlosabalde
carlosabalde / bookmarklet.js
Last active November 20, 2019 15:09
Simple bookmarklet to flush the state of the New York Times metered paywall. Once the 10 articles per month limit is reached and the subscription popup raises, simply click on the bookmarklet. Your metering quota will be reset to 0 and the current page reloaded to show the full article. Check out comments in the code for further details.
javascript:(function() {
if (window.location.host.match(/nytimes.com$/)) {
/* Flush all cookies. */
var cookies, subdomain, pathname;
cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
subdomain = '.' + window.location.host;
while (subdomain) {
pathname = window.location.pathname;
while (pathname) {