dharmafly / noodle

A node server and module which allows for cross-domain page scraping on web documents with JSONP or POST.
https://noodle.dharmafly.com/
745 stars 69 forks source link

Make responses from html type queries more succinct (and consistent) #88

Closed AaronAcerboni closed 11 years ago

AaronAcerboni commented 11 years ago

Responses from HTML type queries differ from json, xml and feed type queries because html queries take into account an aspect to extract. eg. text, html or some attribute.

Example:

Response from a query to json document

{
  results: [
    {
      foo: 'hello'
    }
  ],
  created: ...
}

Response from a query to a html document

{
  results: [
    {
      foo: {
        text: 'hello'
      }
    }
  ],
  created: ...
}

Responses to html queries should mirror the responses to the other query types in that foo should be a direct value and not an object. That object can still exist but only if either:

OR