NYTimes Layout 2+3

By RonL Last update Jun 21, 2010 — Installed 482 times.

Revision history

in
Subscribe to Revision history 1 post, 1 voice

RonL Script's Author

The NYT home page seems to seesaw between two main versions of its HTML, which I labeled NYTimes Layout2 and NYTimes Layout3. (See descriptions of earlier userscripts with these names.) Rather than continuing to seesaw between these two scripts, I placed a test at the front of the code to try to determine which layout it is encountering. Using the result, I branch to the latest complete script for each layout.

When NYT's variations are fairly regular over time, as with Layout2 and Layout3, I can include a test for one condition or the other. When they introduce a new section of the page, as with Times Wire, I have to scramble. I would welcome advice on how to handle this better.

I regret that all of this change is a little frustrating. The basic problem is that many blocks of NYT HTML have no ID, so I must identify them by their relative positions. When NYT changes that position, I must change the script.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel