Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKuehn committed Apr 14, 2019
2 parents d5af5ee + 06155ba commit b45c003
Show file tree
Hide file tree
Showing 12 changed files with 801 additions and 245 deletions.
18 changes: 18 additions & 0 deletions Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Notes

## Google Scholar Fu
- different publications of the same thing have separate cite counts :/
- google has special symbols
- they matter less for certain searches, but they always modify the search in some way
- that means throwing them out is the best bet
- see [google-shortcut-commands](https://www.wabisabilearning.com/blog/google-shortcut-commands) for a list
- narrow searches
- exact in-title search seems appropriate
- author fields helps, but they are not as straight forward as they seem
- there's quite a lot
- further narrowing down with dates

## Gotchas
- the export part of the module is only relevant for the npm based testing
- what actually loads the plugin into zotero is the `<script/>`-section in overlay.xul!
- i.e. you can just check for `window` and then write your UI callbacks whereever you want them to be
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Zotero Scholar Citations
# Zotero Scholar Citations (ZSC)

This is an add-on for Zotero, a research source management tool. The add-on automatically fetches numbers of citations of your Zotero items from Google Scholar and makes it possible to sort your items by the citations. Moreover, it allows batch updating the citations, as they may change over time.

When updating multiple citations in a batch, it may happen that citation queries are blocked by Google Scholar for multiple automated requests. If a blockage happens, the add-on opens a browser window and directs it to http:https://scholar.google.com/, where you should see a Captcha displayed by Google Scholar, which you need to enter to get unblocked and then re-try updating the citations. It may happen that Google Scholar displays a message like the following "We're sorry... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now." In that case, the only solution is to wait for a while until Google unblocks you.

Currently, Zotero doesn't have any special field for the number of citations, that's why it is stored in the "Extra" field. To sort by this field you have to add it in the source listing table.

**Note** Apparently Zotero now supports [adding custom fields](https://github.com/beloglazov/zotero-scholar-citations/issues/37), soo this might be coming soon(tm)!

*IMPORTANT:* in version 1.8 the field for storing the number of citations has been changed from "Call Number" to "Extra" -- please update your column configuration.

The add-on supports both versions of Zotero:

1. Download the lastest version of the add-on from [the release page](https://github.com/MaxKuehn/zotero-scholar-citations/releases). It's the ".xpi" file.
1. Download the lastest version of the add-on from [the release page](https://github.com/MaxKuehn/zotero-scholar-citations/releases). It's an ".xpi" file.
1. In Zotero (Standalone) go to Tools -> Add-ons -> click the settings button in the top-right corner -> Install Add-on From File -> select the downloaded file and restart Zotero.

Read about how the add-on was made: http:https://blog.beloglazov.info/2009/10/zotero-citations-from-scholar-en.html
Expand All @@ -21,12 +19,38 @@ Read about how the add-on was made: http:https://blog.beloglazov.info/2009/10/zotero-c

The original maintainer [Anton Beloglazov](https://github.com/beloglazov) seems semi-active.

[Texot](https://github.com/tete1030) fixed some stuff that needed fixing BADLY, i.e.
[Texot](https://github.com/tete1030) fixed some stuff that needed fixing BADLY, that is

- Fix detection of google robot checking
- Show `No Citation Data` in failure cases instead of `00000`

**But there's more to do!**
**But there's more that should be done!**

## RoadMap

[RoadMap](https://github.com/MaxKuehn/zotero-scholar-citations/RoadMap.md)

## "Extra"-Column Content Handling
ZSC will
- update legacy ZSC "extra"-content, i.e. 5 digit citation counts and "No Citation Data" strings
- respect content that is in the "Extra"-field as long as it's in `key: value` format
- this includes arXiv, DOI, OCLC, etc.
- problably not combination of those unless they are ` \n` separated

## Why is ZSC unable retrieve the citation count for item X?
The most likely culprit is that ZSC search is too precise :^). Some Items do not have as complete of an author list on google scholar as they have in Zotero.

Here's how you can find out weather that's the problem
1. in Zotero enable debug out `Help > Debug Output Logging > enable`
1. then open the debug console `Help > Debug Output Logging > View Output`
1. try to update the item again
1. look out for something like this `[scholar-citations] GET https://scholar.google.com/scholar?hl=en&as_q=THE_TITLE_OF_YOUR_ITEM&as_epq=&as_occt=title&num=1&as_sauthors=AUTHOR1+AUTHOR2+AUTHOR3`
1. Copy & Paste that search link into a web browser of your choice
1. try removing different authors from the search

One combination of authors will certainly yield the correct search.

You can also temporarly recreate that combination in Zotero. ZSC will then successfully query that item. Once you re-add the author however, updates will fail again. :(

# License

Expand Down
46 changes: 46 additions & 0 deletions RoadMap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# RoadMap

## 2.1.0
- improve captcha handling & introduce request batching
- if you update 200 papers you prob get captchas starting at 100 or so
- all remaining request will run into a captcha an result in a prompt
- even when the captcha situation is resolved, those items won't be update unless another update is requested
- **solution/workaround**
- can't get around some sort of batching/sequencing
- if you throw 100 requests into the event loop, they'll happen no matter what
- i.e. you have to stop throwing requests into the event loop once you get the first captchas, then wait for the captcha to be resolved

## 2.2.0
- author shinanigans
- sometimes papers are not found because not all authors are listed as such on google scholar
- **solution/workaroud**
- if no citation is found retry with permutations of authors, decreasing in number of authors
- depends on the ability to redo requests at will
- probably increases scholar query accuracy
- e.g. "Probabilistic roadmaps for path planning in high-dimensional configuration spaces"
- there's different versions!
- big but(t): might increase rate of false positives

## Soon(tm)
- **note** this is a randomly ordered todo list
- **custom fields**
- [have been planned for ages](https://forums.zotero.org/discussion/65301/adding-a-custom-information-field)
- currently they're planned for Zotero 5.2 (heh)
- automatically update version number (i.e. in install.rdf)
- clean up variable handling
- e.g. `this`/`zsc.` right now zsc. is just an almost global storage for eveything)
- use acutal private variables & closures?
- fix build system, so ppl can contribute
- the whole npm thingy might be a bad idea in the first place
- zsc is run in a browser, it should probably tested that way as well
- but the whole XUL part is nasty AF
- npm/package.json based
- true OS independence
- i.e. I have to fix my tools first
- either go full cygwin stack or full windose (but cmd is soo shit q.q)
- there's no node/npm as a package in cygwin q.q; prob. have to compile it
- alternative: do everything in node
- rework citation field
- can't do this before Zotero 5.2 apparently :(
- change to something more citation related than "extra[as mentioned here](https://github.com/beloglazov/zotero-scholar-citations/issues/37)
- fix citation field type; [also fixes length!](https://github.com/beloglazov/zotero-scholar-citations/issues/31)
14 changes: 3 additions & 11 deletions chrome/content/overlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,18 @@
src="chrome:https://zoteroscholarcitations/locale/zoteroscholarcitations.properties"/>
</stringbundleset>

<menupopup id="zotero-tb-actions-popup">
<menuitem
id="zoteroscholarcitations-tb-actions-export-playground"
label="&zotero.scholarcitations.updateAll.label;"
insertbefore="zotero-tb-actions-utilities-separator"
oncommand="Zotero.ScholarCitations.updateAll();"/>
</menupopup>

<popup id="zotero-collectionmenu">
<menuitem
id="zotero-collectionmenu-scholarcitations"
label="&zotero.scholarcitations.update.label;"
oncommand="Zotero.ScholarCitations.updateSelectedEntity()"/>
label="&zotero.scholarcitations.updateCol.label;"
oncommand="Zotero.ScholarCitations.updateCollectionMenuEntry()"/>
</popup>

<popup
id="zotero-itemmenu">
<menuitem
id="zotero-itemmenu-scholarcitations"
label="&zotero.scholarcitations.update.label;"
oncommand="Zotero.ScholarCitations.updateSelectedItems()"/>
oncommand="Zotero.ScholarCitations.updateItemMenuEntries()"/>
</popup>
</overlay>
Loading

0 comments on commit b45c003

Please sign in to comment.