noodle

Overview

noodle is a node server and module which clients can use to query data from web documents. It features:

  • Cross domain document querying (html, json, xml, atom, rss feeds)
  • Server supports querying via JSONP and JSON POST
  • Multiple queries per request
  • Access to queried server headers
  • Allows for POSTing to web documents
  • In memory caching for query results and web documents

Download

Star the project on GitHub, or download it:

noodle on GitHub Edge (master)

Try it out!

Below is an ace editor where you can try writing a query yourself.

The query below tells noodle to go to the google search result for JavaScript and expect a html file. Then using the selector pick out all of the result anchors. Finally the query says to extract the text for each of those anchor elements.

Press run below to see the output:

var query = {
      url: 'http://google.com/search?q=javascript',
      type: 'html',
      selector: 'h3.r a',
      extract: 'text'
    },
    request;

request = 'http://example.noodlejs.com/?q=' +
          encodeURIComponent(JSON.stringify(query)) +
          '&callback=?';

jQuery.getJSON(request, function (data) {
  console.log(data);
  demoElement.innerHTML = '<pre>' + 
      JSON.stringify(data, null, 4) +
      '</pre>';
});

Noodle queries don’t just support html but also json, feeds and plain xml. They can be a lot more powerful too. Find out all noodle can do.

Server quick setup

Setup

$ git clone https://github.com/dharmafly/noodle.git
$ cd noodle
$ npm install

Start the server by running the binary

$ bin/noodle-server
 Server running on port 8888

You may specify a port number as an argument

$ bin/noodle-server 9090
 Server running on port 9090