server/api methods look for ewa
Hi I am trying to make a request using the server/api methods but it cannot find ewa. I thought it wouldn't be necessary for this. Here's what I am doing.
'var http = require('http'), URL = require('url'), getElements = require('node-bot').getElements;
module.exports = { foo: function () { handleRequest(); }, bar: function () { google_node_bot(); } };
var handleRequest = function (request, response) {
var url = 'http://localhost:8999/getelements?name=nike_shoes&search=nike%20lebron%209®exp=%5C%24%7C%C3%A2%E2%80%9A%C2%AC';
var qs = URL.parse(url);
if (qs.pathname == '/getelements'){ getElements(qs.query,response); }; console.log(response); };
function google_node_bot(){ console.log("google_node_bot is up"); http.createServer(handleRequest).listen(8999); }; '
I think the only difference is I am passing the request url as a variable. Thanks.
The node-ewa module is the one that is parsing the page and extracting what is required according to the parameters passed, in fact you must write an equivalent module according to what you want to do (which I don't know)