tripitakit / xeno-canto Goto Github PK
View Code? Open in Web Editor NEWNode.js xeno-canto API 2.0
License: Other
Node.js xeno-canto API 2.0
License: Other
The function returns a CORS error when used.
First things first, great plugin!
The search results mention that there are several pages of results. How does one retrieve not only the first page, but the second and the third and so on?
Hi Devs
There is a problem with this library?
Seems that the SEARCH feature is not working in my dev environment, here is my code. For any reason the callback is not executed any more
var XenoCanto = require('xeno-canto');
var birdSing = new XenoCanto();
console.log(req.query.sciname);
birdSing.search(req.query.sciname, function (self) {
//code no entering more to this callback
console.log(self.entity.recordings.length);
if (self.entity.recordings.length > 0) {
var request = require('request');
var timeoutInMilliseconds = 10 * 1000;
var opts = {
url: self.entity.recordings[0].file,
method: 'GET',
timeout: timeoutInMilliseconds,
headers:
{
'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163 Safari/537.36'
}
};
request(opts, function (err, res, url) {
if (err) {
body.error = err;
response.send(body);
return;
} else {
var sound = {
file: res.request.uri.href,
url: self.entity.recordings[0].url
};
body.response = sound;
response.send(body);
}
});
} else {
body.response = null;
response.send(body);
}
});
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.