Skip to content

Include https://bibtex.chimbori.com/ as fallback for the ebook.de fetcher#2374

Merged
koppor merged 3 commits into
masterfrom
isbnfetcherupdate
Dec 16, 2016
Merged

Include https://bibtex.chimbori.com/ as fallback for the ebook.de fetcher#2374
koppor merged 3 commits into
masterfrom
isbnfetcherupdate

Conversation

@koppor

@koppor koppor commented Dec 13, 2016

Copy link
Copy Markdown
Member

The fetcher offered by ebook.de does not offer bibtex for all valid ISBNs. This PR adds https://bibtex.chimbori.com/ as fallback for the ebook.de fetcher

Long discussion at: #684 (comment)

I created a meta IsbnFetcher and two separate fetchers for ebook.de and chimbori. I readded the URL field as this is the deal with both ebook.de and chimbori.

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • [n/a] Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • [n/a] If you changed the localization: Did you run gradle localizationUpdate?

Fixes #684

@koppor koppor force-pushed the isbnfetcherupdate branch 3 times, most recently from 183c1c2 to 630e054 Compare December 13, 2016 00:25
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 13, 2016

@tobiasdiez tobiasdiez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments as I have no time right now for a real review

@Override
public Parser getParser() {
return new BibtexParser(importFormatPreferences);
IsbnViaEbookDeFetcher isbnViaEbookDeFetcher = new IsbnViaEbookDeFetcher(importFormatPreferences);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the architecture that a fetcher controls other fetcher. All of them should be completely independent and their working-together should be controlled at a higher level. Moreover, I would allow the user to choose between "ISBN (ebook.de)" and "ISBN (Chimbori/Amazon)", or is the quality of ebook's metadata really superior?

@koppor koppor Dec 13, 2016

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it should be transparent to the user, so that he does not need think, what fetcher he wants to use. We could also offer all three fetchers to the user so that if he really wants to choose.

It is the deal with Chimbori that we use ebook.de first to reduce load on his server. The deal was made in personal emails I exchanged with the author of Chimbori


HttpResponse<String> postResponse;
try {
postResponse = Unirest.post("https://bibtex.chimbori.com/isbn-bibtex")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rewrite IdBasedParserFetcher so that it also supports POST actions (and maybe uses Unirest for it).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether it is worth the effort - I think, we currently have only one exception for that.


@Override
public void doPostCleanup(BibEntry entry) {
// We MUST NOT clean the URL. this is the deal with ebook.de

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that we have such an agreement with ebook.de

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can forward you the emails I exchanged with them.

@koppor koppor added this to the v3.8 milestone Dec 13, 2016
@koppor

koppor commented Dec 13, 2016

Copy link
Copy Markdown
Member Author

Update: Fixes #2343

@koppor koppor force-pushed the isbnfetcherupdate branch 2 times, most recently from 8f765b3 to 74b5527 Compare December 13, 2016 22:34
- Introduce AbstractIsbnFetcher
- Name the fetchers differently
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.util.ISBN;

public abstract class AbstractIsbnFetcher implements IdBasedParserFetcher {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here IdBasedFetcher should be sufficient and then IsbnViaEbookDeFetcher implements IdBasedParserFetcher (in addition to AbstractIsbnFetcher)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In IsbnViaChimboriFetcher, I need both doPostCleanup() and getParser() which are not offered by IdBasedFetcher.

Don't want to introduce a new intermediate class...

@tobiasdiez tobiasdiez removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 16, 2016
@koppor koppor merged commit 566541d into master Dec 16, 2016
@koppor koppor deleted the isbnfetcherupdate branch December 16, 2016 16:40
@manastungare

Copy link
Copy Markdown

It is the deal with Chimbori that we use ebook.de first to reduce load on his server. The deal was made in personal emails I exchanged with the author of Chimbori

This was our conversation regarding the version that I had self-hosted, before I set up the dedicated service at bibtex.chimbori.com. Feel free to send all your traffic to this new endpoint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants