Skip to content

Commit

Permalink
NYTimes: Strip "(Published [YEAR])" from old articles
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Jan 22, 2021
1 parent 9b84c2c commit 1b6061a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NYTimes.com.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2020-11-02 07:42:08"
"lastUpdated": "2021-01-22 19:34:13"
}

/*
Expand Down Expand Up @@ -113,6 +113,8 @@ function scrape(doc, url) {
if (item.title == item.title.toUpperCase()) {
item.title = ZU.capitalizeTitle(item.title, true);
}
// Strip "(Published [YEAR])" from old articles
item.title = item.title.replace(/\s+\(Published \d{4}\)$/, '');
// Only force all caps to title case when all tags are all caps
var allcaps = true;
for (let i = 0; i < item.tags.length; i++) {
Expand Down

0 comments on commit 1b6061a

Please sign in to comment.