Open jurban1997 opened 7 years ago
// I'm new to github. Please help me get this to where it is best utilized. //this is a revised version of the code on the noodlejs.com site
var jsdom = require('jsdom').jsdom; var document = jsdom('', {}); var window = document.defaultView; var $ = require('jquery')(window); var query = { url: 'http://google.com/search?q=corverity', type: 'html', selector: 'h3.r a', extract: 'text' }; var uriQuery = encodeURIComponent(JSON.stringify(query)); var request = 'http://127.0.0.1:8888/?q=' + uriQuery + '&callback=?'; console.log(request); // Make Ajax request to Noodle server $.getJSON(request, function (data) { console.log(data[0].results); });
// I'm new to github. Please help me get this to where it is best utilized. //this is a revised version of the code on the noodlejs.com site
var jsdom = require('jsdom').jsdom; var document = jsdom('', {}); var window = document.defaultView; var $ = require('jquery')(window); var query = { url: 'http://google.com/search?q=corverity', type: 'html', selector: 'h3.r a', extract: 'text' }; var uriQuery = encodeURIComponent(JSON.stringify(query)); var request = 'http://127.0.0.1:8888/?q=' + uriQuery + '&callback=?'; console.log(request); // Make Ajax request to Noodle server $.getJSON(request, function (data) { console.log(data[0].results); });