eventful-node
v1.1.1
Published
super thin eventful client api library
Downloads
99
Readme
eventful-node
A simple client library for the Eventful API for event searching. (http://api.eventful.com). This library is a very limited subset of the Eventful API and does not include any authenitcation-required APIs.
Getting Started
To install do:
npm install eventful-node
Then you can require and intiailze a new client with your api_key:
var eventful = require('eventful-node');
var client = new eventful.Client(<YOUR EVENTFUL API KEY>);
Searching for events
To search you can use the search function. Pass a searchEventOptions and the callback.
client.searchEvents({ options }, callback);
Example - Get all events listed in eventful with keyword 'music':
client.searchEvents({ keywords: 'music' }, function(err, data){
if(err){
return console.error(err);
}
console.log('Recieved ' + data.search.total_items + ' events');
console.log('Event listings: ');
//print the title of each event
for(var i in data.search.events){
console.log(data.search.events[i].title);
}
});
Getting Possible Event Cateogires
client.listCategories(function(err, data){
if(err){
return console.error(err);
}
for(var i in data){
console.log('Available event categories: ');
console.log('id:' + data[i].id);
console.log('id:' + data[i].name);
}
});
Building
This library is built and tested using gruntjs. Be sure to have the grunt command line interface (cli) installed globally on your machine:
# On some systems, you may need to run this command with sudo
npm install grunt-cli -g
To build eventful-node, fork or clone this repository and do:
npm install --dev
grunt
This will compile the typescript into javascript, minify it and place it in the ./bin folder.
Testing
To run the associated unit tests do:
Unix/Linux:
export API_KEY=<YOUR_EVENTFUL_API_KEY>
grunt test
Windows:
set API_KEY=<YOUR_EVENTFUL_API_KEY>
grunt test
Contributing
You can find the latest build status here
This library is written in typescript and as such contributions must be made in typescript. To make things easier, you can start this grunt watch task which will automatically validate and compile your typescript from ./src/eventful-node.ts to javascript in ./lib/eventful-node.js.
grunt watch
Please check the issues tab with 'help wanted' issues to contribute.