aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-08-21Use `window.location.assign` instead of `location.assign`HEADmasterTeddy Wing
Previously the `choice.npr.org` page wasn't showing up in history. Using `window` appears to fix this and correctly add the choice page to browser history.
2018-08-21Handle cases where the article ID isn't in 6th positionTeddy Wing
In this example: https://www.npr.org/sections/thesalt/2018/08/20/636845604/beer-drinking-water-and-fish-tiny-plastic-is-everywhere the article ID isn't in the position we expect it to be, and we instead get `08` as the `article_id`. Instead of expecting the article ID to always be in the same spot, look for it in the second-from-last position.
2018-08-06Add READMETeddy Wing
2018-08-06Add license (GNU GPLv3+)Teddy Wing
2018-08-06User script to redirect to NPR's text versionTeddy Wing
Since the site doesn't provide a function to do this, make a mechanism to do it automatically. The text mode version is light and doesn't track visitors. In order to redirect to the text version of the article, we pull out the article's ID and use it in the text mode URL. Thanks to these MDN docs explaining how to parse query string arguments: - https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams#Example - https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get#Example