How to use the tmp.scraper function in tmp

To help you get started, we’ve selected a few tmp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lukluk / scraper-engine / scraper-engine.js View on Github external
scr.req = req
            console.log('next')
            self.html = content
            self.doRun(scr, [], function(result, res) {
              if (type == 'json')
                res.json(result)
              else {
                res.csv(result, 'output.csv')
              }
            }, res)
          })
        } else {
          scr.onInit && scr.onInit(req, res)
          scr.req = req
          self.html = false
          self.doRun(scr, [], function(result, res) {
            if (type == 'json')
              res.json(result)
            else {
              res.csv(result, 'output.csv')
            }
          }, res)
        }
      }
    }
  },
  routes: function() {