smlum/zotero-scholar-citations

Fails for items with many authors

vince-p opened this issue · 0 comments

The extension seems to fail when the search string is very long.
I can see from the debug log that this URL is being searched:

https://scholar.google.com/scholar?hl=en&as_q=Safety,+tolerability,+pharmacokinetics,+and+pharmacodynamics+of+low+dose+lysergic+acid+diethylamide+(LSD)+in+healthy+older+volunteers&as_epq=&as_occt=title&num=1&as_sauthors=Family+Maillet+Williams+Krediet+Carhart-Harris+Williams+Nichols+Goble+Raz&as_ylo=2020&as_yhi=2020

But when I visit that web page, I can see that google truncates the main part of the search string. This is what is visible in the search box on the google scholar website when visiting that link:

allintitle: Safety, tolerability, pharmacokinetics, and pharmacodynamics of low dose lysergic acid diethylamide (LSD) in healthy older volunteers author:Family author:Maillet author:Williams author:Krediet author:Carhart-Harris author:Williams author:Nicho

ie, google is truncating the search string to 476 characters (despite the full URL being correct). This is odd as google does search the correct year, even though that information is at the end of the URL.

This could be fixed by checking the length of the search string and not adding any new search terms that would result in a length >476