Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd translator for svd.se #1690
Conversation
zuphilip
added
the
New Translator
label
Jul 10, 2018
This comment has been minimized.
This comment has been minimized.
I've updated according to the comments in #1691. Let me know if there's anything else. |
adam3smith
requested changes
Aug 22, 2018
Thanks! Some small requests. |
"abstractNote": "Nya Karolinska-skandalen har blivit en nationell fråga som riskerar att skada Sveriges rykte som innovationsland. Det säger närings- och innovationsminister Mikael Damberg (S) till SvD.", | ||
"language": "sv", | ||
"libraryCatalog": "www.svd.se", | ||
"publicationTitle": "SvD.se", |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
"title": "Snapshot" | ||
} | ||
], | ||
"tags": [], |
This comment has been minimized.
This comment has been minimized.
adam3smith
Aug 22, 2018
Collaborator
You should be able to add tags using doc.querySelectorAll("#ArticleTags-tag-link")
and then cycle through the result, textContent
and push to tags.
This comment has been minimized.
This comment has been minimized.
item.creators = []; | ||
// The author string is in the format: | ||
// FirstName LastName | Email | ||
var authorString = attr(doc, 'meta[name="author"]', "content"); |
This comment has been minimized.
This comment has been minimized.
adam3smith
Aug 22, 2018
Collaborator
again, are we sure there are never multiple? Otherwise better to querySelectorAll
and loop through results.
This comment has been minimized.
This comment has been minimized.
sebastian-berlin-wmse
Aug 31, 2018
Author
Contributor
I haven't come across any case where there were multiple authors when developing this translator. If an article like that is discovered, I'm happy to add functionality for handling that, but I don't want to guess what it would look like.
"translatorID": "7adba17c-7e98-4a13-8325-e19383b09eab", | ||
"label": "Svenska Dagbladet", | ||
"creator": "Sebastian Berlin", | ||
"target": "^https://www\\.svd\\.se/(sok\\?)?", |
This comment has been minimized.
This comment has been minimized.
adam3smith
Aug 22, 2018
Collaborator
if the last element has a ?, you don't need it. I'd just use ^https://www\\.svd\\.se/.
, i.e. every page on the site other than the homepage.
This comment has been minimized.
This comment has been minimized.
adam3smith
merged commit 9d070c3
into
zotero:master
Sep 6, 2018
1 check passed
This comment has been minimized.
This comment has been minimized.
Great, thanks! |
sebastian-berlin-wmse commentedJul 6, 2018
This is the website for the Swedish newspaper Svenska Dagbladet.