New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Old Bailey Online.js #1760
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"inRepository": true, | ||
"translatorType": 4, | ||
"browserSupport": "gcsibv", | ||
"lastUpdated": "2018-10-08 14:06:13" | ||
"lastUpdated": "2018-10-08 14:15:17" | ||
} | ||
|
||
/* | ||
|
@@ -86,13 +86,14 @@ if (url.includes('browse.jsp') && ( url.includes('div=OA') || url.includes('nam | |
var trialTitle = ZU.xpathText(doc, '//div[@class="sessionsPaper"]/div[@class="sessions-paper-main-title"]'); // updated @class name | ||
|
||
|
||
|
||
newItem.url = url; | ||
|
||
var sessDate = ZU.xpathText(doc, '//div[@class="sessionsPaper"]/div[@class="sessions-paper-date"]'); // add session date, as the date is now in a gettable node | ||
|
||
newItem.date = ZU.strToISO(sessDate); | ||
|
||
if (newItem.itemType == "case" && newItem.title && newItem.title == newItem.title.toUpperCase()) { | ||
if (newItem.itemType == "case" && trialTitle && trialTitle == trialTitle.toUpperCase()) { | ||
newItem.title = ZU.capitalizeTitle(trialTitle, true); // todo tidying this up - sometimes no name, messy punctuation | ||
} else if (newItem.itemType == "book") { | ||
newItem.title = trialTitle + " " + sessDate; | ||
|
@@ -296,6 +297,40 @@ var testCases = [ | |
"seeAlso": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "web", | ||
"url": "https://www.oldbaileyonline.org/browse.jsp?id=t16780828-12&div=t16780828-12&terms=hog#highlight", | ||
"items": [ | ||
{ | ||
"itemType": "case", | ||
"caseName": ".", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That doesn't seem right/helpful as data import. I think what I would do is strip all trailing periods and commas, and then set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What you suggest looks fine for me. |
||
"creators": [], | ||
"dateDecided": "1678-08-28", | ||
"docketNumber": "t16780828-12", | ||
"extra": "Reference Number: t16780828-12", | ||
"url": "https://www.oldbaileyonline.org/browse.jsp?id=t16780828-12&div=t16780828-12&terms=hog#highlight", | ||
"attachments": [ | ||
{ | ||
"title": "OBO Snapshot", | ||
"mimeType": "text/html" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"tag": "Guilty" | ||
}, | ||
{ | ||
"tag": "Theft" | ||
}, | ||
{ | ||
"tag": "animal theft" | ||
} | ||
], | ||
"notes": [], | ||
"seeAlso": [] | ||
} | ||
] | ||
} | ||
] | ||
/** END TEST CASES **/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to split this further up, because maybe also
trialTitle
for acase
might exitsts which is not all uppercase: