tasks/generator/Scraper.js
function(tableUrl)
    {
        var _this = this;

        return Q.nfcall(request, tableUrl).then(function(data) {
            var $     = cheerio.load(data);
            var title = $('h2').first().text();
            var $rows = $('table tr');

            _this.tables.push(title);

            var ret = {
                tableName: title,
                description: '',
                fields: []
            };

            $rows.each(function() {
                var $row = $(this);
                var name = $row.find('td').first().text();
                var type = $row.find('td:nth-child(2)').text();
                var access = $row.find('td:nth-child(3)')
                    .text().toLowerCase().trim().split(' ');

                if (!name) return;

                ret.fields.push({
                    name: name,
                    type: type,
                    access: access
                });
            });

            return ret;
        });
    }
function(tableUrl)
    {
        var _this = this;

        return Q.nfcall(request, tableUrl).then(function(data) {
            var $     = cheerio.load(data);
            var title = $('h2').first().text();
            var $rows = $('table tr');

            _this.tables.push(title);

            var ret = {
                tableName: title,
                description: '',
                fields: []
            };

            $rows.each(function() {
                var $row = $(this);
                var name = $row.find('td').first().text();
                var type = $row.find('td:nth-child(2)').text();
                var access = $row.find('td:nth-child(3)')
                    .text().toLowerCase().trim().split(' ');

                if (!name) return;

                ret.fields.push({
                    name: name,
                    type: type,
                    access: access
                });
            });

            return ret;
        });
    }
function ( tableUrl ) { var _this = this ; return Q . nfcall ( request , tableUrl ) . then ( function ( data ) { var $ = cheerio . load ( data ) ; var title = $ ( 'h2' ) . first ( ) . text ( ) ; var $rows = $ ( 'table tr' ) ; _this . tables . push ( title ) ; var ret = { tableName : title , description : '' , fields : [ ] } ; $rows . each ( function ( ) { var $row = $ ( this ) ; var name = $row . find ( 'td' ) . first ( ) . text ( ) ; var type = $row . find ( 'td:nth-child(2)' ) . text ( ) ; var access = $row . find ( 'td:nth-child(3)' ) . text ( ) . toLowerCase ( ) . trim ( ) . split ( ' ' ) ; if ( ! name ) return ; ret . fields . push ( { name : name , type : type , access : access } ) ; } ) ; return ret ; } ) ; }
Scrape the actual table page to get the individiual fields
Scrape the actual table page to get the individiual fields