mobile.de-api-reader

0.0.1-aplha1 • Public • Published

mobile.de-api-reader

Simple XML receiver of the mobile.de API.

Just edit config.json and:

var config       = require('./config.json'),       // config file
    xmlApiReader = require('./lib/xmlApiReader'),  // receives the XML from the API
    eventEmitter = require('events').EventEmitter; // because node.js...

// We won't run without the http settings.
if (!config.api) {
    throw new Error("Config is incomplete!");
}

var eventHandler = new eventEmitter;
var xmlReader    = new xmlApiReader;

// Set the Event Handler
xmlReader.setApiConfig(config.api);

// Instanciate the API reader
xmlReader.setEventHandler(eventHandler);

// Read the API
xmlReader.readApi();

eventHandler.on('xml_api_read', function(){
    // fancy business logic
    console.log("awesome!");
});

Readme

Keywords

none

Package Sidebar

Install

npm i mobile.de-api-reader

Weekly Downloads

0

Version

0.0.1-aplha1

License

MIT

Last publish

Collaborators

  • doertedev