| Summary: | Support for searching and adding book citations (e.g. from Google Books, WorldCat) | ||
|---|---|---|---|
| Product: | [Applications] KBibTeX | Reporter: | Adam Fontenot <adam.m.fontenot+kde> |
| Component: | Network/online search | Assignee: | Thomas Fischer <fischer> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | 0.10 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/office/kbibtex/-/commit/6f462f5950b2b78e86fa4381c818ee48ecc15706 | Version Fixed/Implemented In: | 0.11 |
| Sentry Crash Report: | |||
|
Description
Adam Fontenot
2024-03-24 21:14:24 UTC
I agree that having an ISBN search is useful. I was not aware that Google Books offered an API for that without the need for registration or API keys. I made an initial version. Please test and check if it is working. https://invent.kde.org/thomasfischer/kbibtex/-/commit/8e723e9f3cf7b0f8b9895edeb6b83147c4e4033c For WorldCat OCLC, KBibTeX had support until 5-10 years ago. It was removed as API keys became necessary and KBibTeX didn't get one. Scrapping webpages would only a last resort as it can break at any point in time. Thanks for working on this! It took some effort to build against Qt6, but I did succeed and all the books I've tried so far are working.
Couple of thoughts:
It probably makes sense to synthesize an ID field rather than using the Google Books ones that look like "GoogleBooks:fnG8BAAAQBAJ".
The URL field has a bunch of useless stuff in it, all of the following links for this book are previews of the book:
{http://books.google.com/books/download/Ecoregions-sample-epub.acsm?id=fnG8BAAAQBAJ&format=epub&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api http://books.google.com/books/download/Ecoregions-sample-pdf.acsm?id=fnG8BAAAQBAJ&format=pdf&output=acs4_fulfillment_token&dl_type=sample&source=gbs_api http://play.google.com/books/reader?id=fnG8BAAAQBAJ&hl=&source=gbs_api}
It would be better to link to the official Google Books page, even if the link has to be synthesized: https://books.google.com/books?id=fnG8BAAAQBAJ
(In reply to Adam Fontenot from comment #2) > Thanks for working on this! It took some effort to build against Qt6, but I > did succeed and all the books I've tried so far are working. KBibTeX's master branch (still) supports Qt5 and Qt6 equally well, so you can continue to use it with your existing KF5 installation. > It probably makes sense to synthesize an ID field rather than using the > Google Books ones that look like "GoogleBooks:fnG8BAAAQBAJ". Ok, changed to use the ISBN. > The URL field has a bunch of useless stuff in it, all of the following links > for this book are previews of the book: >[..] > It would be better to link to the official Google Books page, even if the > link has to be synthesized: https://books.google.com/books?id=fnG8BAAAQBAJ Fixed. There were some other issues and bugs I fixed as well. I also noted that Google Books allows to download BibTeX code directly via another URL, but the data, even for the same book, is not the same. Thus, this revised search uses both sources/methods and then merges the results. I made a force-push, in case you wonder. Git commit 6f462f5950b2b78e86fa4381c818ee48ecc15706 by Thomas Fischer. Committed on 24/11/2024 at 21:55. Pushed by thomasfischer into branch 'master'. Initital version of 'Google Books' search ... which allows to search for books by using their ISBN. This search engine is the first implementation making use of an extended version of the Python script already used to for XML-based search engines (see commit c48fe708e23916f8e659). This script has been extended and refactored to parse JSON data (as returned by Google Books) similar to how XML data is parsed. Bibliographic entries' fields are extracted from the JSON data using immediately invoked function expressions (IIFE) snipplets stored in file onlinesearchgooglebooks-parser.in.cpp M +1 -0 ChangeLog M +1 -1 format_source_files.sh M +3 -1 src/networking/CMakeLists.txt M +193 -70 src/networking/onlinesearch/onlinesearch-parser-generator.py A +62 -0 src/networking/onlinesearch/onlinesearchgooglebooks-parser.in.cpp * A +250 -0 src/networking/onlinesearch/onlinesearchgooglebooks.cpp [License: GPL(v2.0+)] A +61 -0 src/networking/onlinesearch/onlinesearchgooglebooks.h [License: GPL(v2.0+)] M +4 -2 src/program/docklets/searchform.cpp M +62 -0 src/test/kbibtexnetworkingtest.cpp M +6 -1 src/test/kbibtextest.cpp The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page. https://invent.kde.org/office/kbibtex/-/commit/6f462f5950b2b78e86fa4381c818ee48ecc15706 |