fredericd / coce Goto Github PK
View Code? Open in Web Editor NEWBook image cover cache
License: GNU General Public License v3.0
Book image cover cache
License: GNU General Public License v3.0
I've had an issue (#8) open for a while and not had a response. We're hoping to use coce in production soon, but are reluctant to do so if it's still unstable.
Is this project abandoned? If so I'll possibly fork it and try and fix the problems.
Are there any plans to incorporate Syndetics into the mix? It would be nice to be able to include Syndetics into the options rather than side-by-side with Coce.
I'm having a problem, and I think it's configured correctly, where Amazon is returning {} instead of a URL.
I think (but I could be wrong...) that Amazon now throttles calls to the Advertising API. For example:
ID 0684835290 not found on AWS because Throttling
and see here: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/TroubleshootingApplications.html#efficiency-guidelines
Coce certainly does more calls than that per second?
For whatever reason, Koha proper doesn't seem to have this problem with Amazon covers, but we don't require the Associate ID and go about it slightly differently there.
Just wondering if you had noticed it?
Good Morning,
I'm having the following error when trying to use:
23:02:21 web.1 | started with pid 3252
23:02:22 web.1 |
23:02:22 web.1 | module.js:340
23:02:22 web.1 | throw err;
23:02:22 web.1 | ^
23:02:22 web.1 | Error: Cannot find module 'coce'
23:02:22 web.1 | at Function.Module._resolveFilename (module.js:338:15)
23:02:22 web.1 | at Function.Module._load (module.js:280:25)
23:02:22 web.1 | at Module.require (module.js:364:17)
23:02:22 web.1 | at require (module.js:380:17)
23:02:22 web.1 | at Object. (/Volumes/Dados/Documents/Projetos/leevru/index.js:3:12)
23:02:22 web.1 | at Module._compile (module.js:456:26)
23:02:22 web.1 | at Object.Module._extensions..js (module.js:474:10)
23:02:22 web.1 | at Module.load (module.js:356:32)
23:02:22 web.1 | at Function.Module._load (module.js:312:12)
23:02:22 web.1 | at Function.Module.runMain (module.js:497:10)
23:02:22 web.1 | exited with code 8
23:02:22 system | sending SIGTERM to all processes
My code is here:
var coce = require('coce');
app.get('/isbn', function(request, response) {
var ids = '275403143X'.split(',');
var providers = 'gb'.split(',');
var fetcher = new coce.CoceFetcher(2000);
fetcher.fetch(ids, providers, function(url) {
response.send("Teste");
});
});
Can you help me?
Thanks
Sometimes a library gets a book or places an order before a title is released and all services may not have a cover yet.
It would be nice to have an option to expire cached blanks before cached covers found
I've no idea if the underlying APIs will even make this possible, however, it would be good to be able to specify a preferred protocol for the returned cover URLs (HTTP/HTTPS) and, if a cover is not available using the preferred protocol, a fallback URL is provided.
As I say, I've no idea if the various APIs provide both HTTP & HTTPS cover URLs but, if they do, this would be a good addition to Coce I think.
The sample coce config "config.json.sample" is missing the "accessKeyId" parameter relating to AWS credentials. This leads to getting no results from Amazon and regular application crashes with the following error:
/home/coce/coce/node_modules/aws-lib/lib/aws.js:78
if (err) throw err;
^
Error: metadata API response undefined
at ClientRequest.
(/home/coce/coce/node_modules/aws-lib/lib/aws.js:37:49)
at ClientRequest.g (events.js:180:16)
at ClientRequest.emit (events.js:92:17)
at Socket.emitTimeout (http.js:1797:10)
at Socket.g (events.js:180:16)
at Socket.emit (events.js:92:17)
at Socket._onTimeout (net.js:326:8)
at Timer.unrefTimeout as ontimeout
This is the same error reported at http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9580#c60
Adding the "accessKeyId" parameter to the config seems to fix the problem.
There are a couple of errors that can be thrown including 'id parameter is missing'.
These should be returned as json bodies to enable automatic handling at the other end as a posed to a special case having to be written.
Patch to follow
Seeing fairly regular crashes of coce with the following error:
http.js:690
throw new Error('Can\'t set headers after they are sent.');
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:690:11)
at ServerResponse.res.setHeader (/home/coce/coce/node_modules/express/node_m
odules/connect/lib/patch.js:134:22)
at ServerResponse.res.set.res.header (/home/coce/coce/node_modules/express/l
ib/response.js:583:10)
at ServerResponse.res.contentType.res.type (/home/coce/coce/node_modules/exp
ress/lib/response.js:450:15)
at null.finish (/home/coce/coce/app.js:58:17)
at CoceFetcher.increment (/home/coce/coce/coce.js:192:14)
at IncomingMessage.<anonymous> (/home/coce/coce/coce.js:114:18)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:442:13)
We've been unable to determine the cause. Is there any debugging at our end that we can turn on that may help us find out what is causing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.