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/1.9.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKuehn committed Apr 7, 2019
2 parents e549222 + 5e52311 commit d5af5ee
Show file tree
Hide file tree
Showing 8 changed files with 1,858 additions and 470 deletions.
88 changes: 87 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,88 @@
.project
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Custom Misc
build/
builds/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ When updating multiple citations in a batch, it may happen that citation queries

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 comming soon(tm)!
**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 newest version of the add-on from [the release page](https://github.com/MaxKuehn/zotero-scholar-citations/releases)
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. 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: https://blog.beloglazov.info/2009/10/zotero-citations-from-scholar-en.html
Expand All @@ -21,12 +21,12 @@ Read about how the add-on was made: 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, i.e.

- 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 to do!**

# License

Expand Down
11 changes: 3 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/bin/sh

version=1.9.4
rm build -rf
if [ -z $DEBUG ]; then
zip -r builds/zotero-scholar-citations-${version}-fx.xpi chrome/* chrome.manifest install.rdf
else
zip -r builds/zotero-scholar-citations-${version}-debug.xpi chrome/* chrome.manifest install.rdf
fi
version=$npm_package_version
mkdir -p build
zip -r build/zotero-scholar-citations-${version}-fx.xpi chrome/* chrome.manifest install.rdf
16 changes: 8 additions & 8 deletions chrome/content/scripts/zoteroscholarcitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,22 @@ Zotero.ScholarCitations.updateNextItem = function() {
Zotero.ScholarCitations.generateItemUrl = function(item) {
var baseUrl = 'https://scholar.google.com/';
var url = baseUrl +
'scholar?hl=en&as_q=' +
encodeURIComponent(item.getField('title')).replace(/ /g, '+') +
'&as_occt=title&num=1';
'scholar?hl=en&as_q=' + item.getField('title') + '&as_occt=title&num=1';

var creators = item.getCreators();
if (creators.length > 0) {
url += '&as_sauthors=' +
encodeURIComponent(creators[0].lastName).replace(/ /g, '+');
url += '&as_sauthors=';
creators.forEach(function (creator) {
url += creator.lastName + ' ';
});
} else {
var date = item.getField('date');
if (date != '') {
url += '&as_ylo=' + date + '&as_yhi=' + date;
}
}

return url;
return encodeURI(url);
};

Zotero.ScholarCitations.updateItem = function(item) {
Expand Down Expand Up @@ -204,7 +204,7 @@ Zotero.ScholarCitations.updateItem = function(item) {

Zotero.ScholarCitations.fillZeros = function(number) {
var output = '';
var cnt = 5 - number.length;
var cnt = 7 - number.length;
for (var i = 0; i < cnt; i++) {
output += '0';
}
Expand All @@ -227,7 +227,7 @@ Zotero.ScholarCitations.getCitationCount = function(responseText) {
var citeExists = responseText.search('Cited by');
if (citeExists == -1) {
if (resultExists)
return '00000';
return '0000000';
else
return 'No Citation Data';
}
Expand Down
Loading

0 comments on commit d5af5ee

Please sign in to comment.