↑ Return to B50 Amazon Books Backend

PRIV B51 Author Filter


Page no: B51

 

Requirement:

problem

The following is a smaller problem: Inside the {author string}, Amazon separates authors as follows
most often with “;” sometimes with “,” or ” ” or ” and ” or ” und ” or other word separators for different languages

Example of such an {author string}: “Burda Franz Hanns Adam Faerber und Martin Ronicke”


 

Input parameters:

a) Author for search in Amazon; b) WordPress user id; c) Amazon Store

 

Search String

We start with pattern2 for searching (no change in search string)

Hans-Werner Sinn

–> we search with a) “Hans-Werner.Sinn” or “adam.martin”
(dot is separator between first and last, – seperates multiple first or multiple last names)

 

Amazon call

We call Amazon with the parameters a) Author and c) Amazon Store

We cannot limit the result set already from the beginning. Instead we choose the non-strict API call and apply a filtering after that.

 

Amazon Return

Amazon returns a lot of books. Each book has an {author string} that contains many authors. It is not guaranteed that our author is inside.
With the non-strict API call, we obtain a list of Amazon books. Each of these books has 1 or many authors.

Filter the Author String

The authors string may have two format:

Format1: {FirstName} {LastName}  with a space

Format2: {LastName}, {FirstName} with a comma

We match only when either Format1 or Format2 is fulfilled.

 

Not matched:
1) Book 3864 search “adam.martin”,
AuthorsString = “Burda Franz Hanns Adam Faerber und Martin Ronicke” does not match

2) “Sinn, Werner” does not match search “hans-werner.Sinn”

3) Sinn Hans-Werner does not match search hans-werner.sinn  (with space)

 

Matched:
1) “Werner Sinn, Paul Dobereit” matches search “werner.sinn”

2) “Sinn, Hans-Werner; Dobereit, Paul” matches search “hans-werner.sinn”

3) “Martin, Adam; Petersen, Paul” matches search adam.martin

4) “Sinn, Hans-Werner” matches search “hans-werner.sinn”   (with comma!)

 

Upper-Case or Lower-Case letters
We accept both lower and upper case letter as first character for both input string and author string
So Sinn or sinn is indifferent, both are accepted.

 

Check on duplicate books

The check on duplicate books is based on the following:

If Title(book1) = Title (book2) AND Author(book1) = Author (book2)

In this case the book is not created.
Remark:
To my mind, this check should be used only when

book1 or book2 have an empty ISBN (or EAN)
if both books have an ISBN (or EAN) then we should these book identifiers.

 

Complex Rules: Not implemented

Case1: An author has a double first names, like Hans-Werner Sinn
Search Pattern={firstName1-firstName2.LastName}

In this case we would also like {firstName2.LastName} to find results, i.e. “Werner.Sinn”, while “Hans.Sinn” will not give the same result as Hans-Werner Sinn.

Case2: An author has a double last name, like Anke Domscheit-Berg
Search Pattern= {firstName1.LastName1-LastName2}
Here also we need like that {firstName1.LastName1} leads to an results, hence “Anke Domscheit”, while “Anke.Berg” does not make sense. The reason is that the person owned typically puts his/her old last name first and the old name is more important.

Case3: Russian/Bulgarian/Ukrainian name, like Michail Sergejewitsch Gorbatschow
Search Pattern={firstName.FathersName.FamilyName}
Here the FathersName can be omitted. This might be more complicated and we leave it for now. The admin user should simply search with {firstName.FamilyName} and leave out the family name.

Books are accepted when
search pattern1 matches method1 or
search pattern1 matches method2 or
search pattern2 matches method1 or
search pattern2 matches method2

 

Change requests

Distinguish Amazon_author and Amazon_contributors

 

The Amazon API gives two fields:
Amazon_author and Amazon_contributor.
Contributor can be editor, illustrator or translator,…
For contributors we do not get more information which role they fulfill.We should load the field exactly as is.
filter

Contributors on the front-end

In the front-end we should write
Editor/Translator (instead contributor)

Contributor in GUI Amazon Loader

Contributors on the back-end

Amazon Contributors Backend

See more for B5x Amazon Books Backend