Git Product home page Git Product logo

xeno-canto's People

Contributors

camilokorea avatar rowanoulton avatar tripitakit avatar unclesamulus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

xeno-canto's Issues

CORS Error

The function returns a CORS error when used.

Access different pages from search results

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?

Search Feature not working

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);
                    }

                });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.