Page MenuHomePhabricator

Extract page from Google Books in Citoid
Open, MediumPublic0 Estimated Story Points

Description

Citoid should extract the page number from a Google Books link if it is included.

For example, this should generate "|page=36":

https://books.google.com/books?id=mObQCwAAQBAJ&pg=PA36

Used in an article:

https://en.wikipedia.org/w/index.php?title=Andries_Hudde&oldid=770172731#cite_ref-1

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Pharos renamed this task from Extract page from Google Gooks in Citoid to Extract page from Google Books in Citoid.Mar 19 2017, 12:53 AM
Mvolz subscribed.

This is not technically speaking a duplicate- "don't strip page out of link" and "add page to citation" are different things.

It's not? The report is "… strips the preview-part of the url and removes the specific page referenced in the link, and does not add the page number as a parameter" which made me thought the task covers both?

Ah, you're right, I didn't notice that was in there. It's possible these will be implemented differently though so I guess I'll make it a subtask then.

Thanks! Sorry for not spelling it out the first time.

I think T113262 is the same task (modifying the Zotero translator to include any parameters needed for WP, and the only one that applies, I presume, is the page number). I might be able to help with tasks like this but I'm unfamiliar with how the WMF Citoid installation works and if there is a set method for hooking into an existing translator

There's no real hook, but we have a fork of the Zotero translators:

https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/services/zotero/translators

So if there are any changes we want that Zotero doesn't want upstream (for instance, they did not want to include the Google books url in the url field because they reserve the url field for links to the full text) then we can put them in the fork.

Mvolz triaged this task as Medium priority.

Writing down before I forget this, but in Zotero "page" is actually an invalid field for type book. So we can't fix this upstream, we'd have to just implement a custom solution for ourselves and extend the mediawiki format to allow page number for google books (which we have done with other properties)

Another option would be to use the "book section" type in lieu of the "book" type, which should take a page or page range