init repo

This commit is contained in:
Patrick De Marta 2013-11-12 01:34:04 +01:00
commit c31df7fe05
8 changed files with 202 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

14
.jshintrc Normal file
View File

@ -0,0 +1,14 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"unused": true,
"boss": true,
"eqnull": true,
"node": true
}

48
Gruntfile.js Normal file
View File

@ -0,0 +1,48 @@
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
nodeunit: {
files: ['test/**/*_test.js'],
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
lib: {
src: ['lib/**/*.js']
},
test: {
src: ['test/**/*.js']
},
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib: {
files: '<%= jshint.lib.src %>',
tasks: ['jshint:lib', 'nodeunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'nodeunit']
},
},
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['jshint', 'nodeunit']);
};

17
LICENSE-GNU-GPL Normal file
View File

@ -0,0 +1,17 @@
Xeno-canto
A node.js implementation of Xeno-canto API 2.0
Copyright (c) 2013 Patrick De Marta
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

31
README.md Normal file
View File

@ -0,0 +1,31 @@
# xeno-canto
Node.js implementation of Xeno-canto API 2.0
"The service provides a database of bird song and sound recordings contributed
and maintained by enthusiasts worldwide.It provides access to search the
connection and play or download recordings and to submit new recordings.
Discussion forums encourage interactions among members of the birding community
to exchange information about bird song and related topics.
API methods support search against the database by specifying the formal Latin
name of a bird species. Returned data provide listings of all recordings
maintained by the service for that species, either with or without URLs for
audio and still image files, or optionally a request can retrieve a single
representative recording. Methods also provide summary statistics about
listings relevant to the species named in the request."
(Source: [Xeno-canto website](http://xeno-canto.org/))
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality.
Lint and test your code using [Grunt](http://gruntjs.com/).
## Release History
12/11/13 xeno-canto inception
## License
Copyright (c) 2013 Patrick De Marta
Licensed under the GNU GPL license.

13
lib/xeno-canto.js Normal file
View File

@ -0,0 +1,13 @@
/*
* xeno-canto
*
*
* Copyright (c) 2013 Patrick De Marta
* Licensed under the MIT license.
*/
'use strict';
exports.awesome = function() {
return 'awesome';
};

42
package.json Normal file
View File

@ -0,0 +1,42 @@
{
"name": "xeno-canto",
"description": "Node.js API for xeno-canto database webservices",
"version": "0.0.0",
"homepage": "",
"author": {
"name": "Patrick De Marta",
"email": "patrick.demarta@gmail.com"
},
"repository": {
"type": "git",
"url": "git://github/tripitakit/xeno-canto.git"
},
"bugs": {
"url": "https://github.com/tripitakit/xeno-canto/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.gnu.org/licenses/"
}
],
"main": "lib/xeno-canto",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "grunt nodeunit"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.3",
"grunt": "~0.4.1"
},
"dependencies": {
"rest": "~1.0.0"
},
"directories" : ["lib", "test"],
"keywords": ["bird","sound","database","webservice","api",
"science", "biology", "zoology", "bioinformatics"]
}

36
test/xeno-canto_test.js Normal file
View File

@ -0,0 +1,36 @@
'use strict';
var xeno_canto = require('../lib/xeno-canto.js');
/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actual, expected, [message])
test.deepEqual(actual, expected, [message])
test.notDeepEqual(actual, expected, [message])
test.strictEqual(actual, expected, [message])
test.notStrictEqual(actual, expected, [message])
test.throws(block, [error], [message])
test.doesNotThrow(block, [error], [message])
test.ifError(value)
*/
exports['awesome'] = {
setUp: function(done) {
// setup here
done();
},
'no args': function(test) {
test.expect(1);
// tests here
test.equal(xeno_canto.awesome(), 'awesome', 'should be awesome.');
test.done();
},
};