User talk:DrThneed/Web2Cit worklist
Newshub XPath
[edit]This XPath seems to work for the publication date on Newshub:
/html/body/div[2]/article/section/div/div/div[1]/div[1]/div/ul/li[1]/div
You can test it in the JavaScript console in your browser by submitting the query like this:
$x("/html/body/div[2]/article/section/div/div/div[1]/div[1]/div/ul/li[1]/div/text()")
However Newshub show the date for recent articles as “5 minutes ago”, there is a better and simpler path in the article metadata at:
/html/body/div[2]/article/meta[1]
The query for this in the console is:
$x("/html/body/div[2]/article/meta[1]/@content")
Probably better to search for the datePublished metadata tag in case they change the web page structure, and this should work.
$x("//meta[@itemprop='datePublished']/@content")[0].value
That should return the date and time as a string in datetime format, and I'm not sure how that is handled by Web2Cit., but hopefully this will help you with the XPath.
--Canley (talk) 03:34, 24 August 2023 (UTC)
- Thanks @Canley. Unfortunately for some reason all three of those break the template, causing the tool to use a fallback template (which is a bit pointless really). So frustrating! Reassuringly for me both your first and second suggestions were things I had already tried (or v similar). There is a tip on the template page about "Any valid XPath v1.0 expression" working, but I don't know enough about XPath to know about versions, or whether there is some other reason this is failing! DrThneed (talk) 08:02, 24 August 2023 (UTC)
- Hmm, I'll have a look at the patterns and try and work it out. --Canley (talk) 11:53, 25 August 2023 (UTC)
DNZB
[edit]Not sure what the citation tool is trying to do, but does it help that we have a perfectly fine citation template for DNZB. Would it help to make the bot realise that it's a DNZB citation and then direct it to use the template? Schwede66 01:11, 23 April 2024 (UTC)
- Kia ora Giantflightlessbirds, here's some background work to the citation tool. Schwede66 07:46, 23 April 2024 (UTC)