var axios = require('axios');
var Q = require('q');
var bins = require('./bins');

module.exports = {
  get: function (local) {
    var src;
    if(local) {
      src = Q(require('../spec/support/genomes'));
    }
    else {
      src = axios.get('http://data.gramene.org/maps/select?type=genome&rows=999999');
    }
    return src
      .then(justTheData)
      .then(binPromise);
  }
};

function justTheData(json) {
  return Q(json.data.response);
}

function binPromise(data) {
  return Q.fcall(bins, data);
}

@@ -273,15 +273,8 @@
 maps
-/select
 ?typ
@@ -291,14 +291,10 @@
 ows=
-999999
+-1
 ');%0A

use simplified url