eklem / search-index-cookbook

A collection of recipes and how to's on interesting use cases with search-index
MIT License
3 stars 5 forks source link

Use morph.io to scrape data #35

Open eklem opened 7 years ago

eklem commented 7 years ago

Show how to get these data over to a norch or search-index instance

eklem commented 7 years ago

Got JavaScript examples here:

var morph_api_url = 'https://api.morph.io/eklem/test/data.json';
var morph_api_params = {
  // Keep this key secret!
  key: '[secret-key]',
  query: "select * from 'data' limit 10"
};

$.ajax({
  url: morph_api_url + '?' + $.param(morph_api_params),
  dataType: 'jsonp',
  success: function(data) {
    console.log('received data: ' + JSON.stringify(data));
  }
});