0.3.0 • Published 9 years ago

page-getter v0.3.0

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

Page Getter

Description

Basic Getter Class - Gets the HTML from a specified link, extracts data using a pipeline of actions, providing events to subscribe to (complete and error).

Installation

npm install page-getter

Example

var PageGetter = require('./models/PageGetter');

var actions = [require('./actions/getTitle')]; /

var link = 'http://alfresco.com';

//Factory function - create a PageGetter object with a given link and an array of actions to be carried out
var getter = PageGetter.create('http://www.richardgaunt.com', [require('./actions/getTitle')]);

//Attach listener and callback to completed event
getter.on('complete', function (data) {
	console.log('callback called', data.result);
});

//kick off process
getter.start();