lib/apis/grandexchange.js
function (data) {
        var items = [];
        data.forEach(function (d, i) {
            if (d.includes('ITEM:') && d.length > 3) {
                var iid = data[i + 1];
                var item = {
                    item: {
                        id: Number(iid[1].trim()),
                        name: d[2].replace(/_/g, ' '),
                        price: d[3],
                        change: d[4]
                    }
                };
                items.push(item);
            }
        });
        return items;
    }
function (data) {
        var items = [];
        data.forEach(function (d, i) {
            if (d.includes('ITEM:') && d.length > 3) {
                var iid = data[i + 1];
                var item = {
                    item: {
                        id: Number(iid[1].trim()),
                        name: d[2].replace(/_/g, ' '),
                        price: d[3],
                        change: d[4]
                    }
                };
                items.push(item);
            }
        });
        return items;
    }
function ( data ) { var items = [ ] ; data . forEach ( function ( d , i ) { if ( d . includes ( 'ITEM:' ) && d . length > 3 ) { var iid = data [ i + 1 ] ; var item = { item : { id : Number ( iid [ 1 ] . trim ( ) ) , name : d [ 2 ] . replace ( / _ / g , ' ' ) , price : d [ 3 ] , change : d [ 4 ] } } ; items . push ( item ) ; } } ) ; return items ; }
Read the RScript data and put it into an item array
Read the RScript data and put it into an item array