Sha256: a3a7b75c71838582c15683c6556a174066937b56f12023f5789754af70a284a5

Contents?: true

Size: 521 Bytes

Versions: 7

Compression:

Stored size: 521 Bytes

Contents

o = {};

$('table.target tr').each(function(index, row){

  first_column = $('td', row).first();
  name = first_column.text().toLowerCase();

  last_column = $('td', row).last().text();

  parts = last_column.split(/\n|,/);
  parts = parts.map( function( el ){ return el.trim(); });

  type = parts.shift();
  description = parts.pop();
  validations = parts.length > 0 ? parts.join(', ') : null;
  o[ name ] = {
    "type": type,
    "validations": validations,
    "description": description
  }
});

JSON.stringify(o);

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fortnox-api-0.5.2 docs/extraction_script.js
fortnox-api-0.5.1 docs/extraction_script.js
fortnox-api-0.5.0 docs/extraction_script.js
fortnox-api-0.4.0 docs/extraction_script.js
fortnox-api-0.3.0 docs/extraction_script.js
fortnox-api-0.2.0 docs/extraction_script.js
fortnox-api-0.1.0 docs/extraction_script.js