New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

docparse-scraper-check-node

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docparse-scraper-check-node

allow node based scrapers to query the docparse api and see if they should download a bill or not

  • 1.1.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

Docparse Scraper Check Node

Allow node based scrapers to query the docparse database see if they should download a bill or not

Installation

npm install docparse-scraper-check-node

Usage

Call the module with your bill number, supplier code, and a cradle db connection to check if a bill should get downloaded or not

var check = require('docparse-scraper-check-node');
// get an api object containing login credentials to the docparse server
var checkData = {
  supplierCode: 'HES',
  billNumber: 'H1268729',
  db: db // a cradle db connection
}
check(checkData, function(err, reply) {
  if (err) {
    console.dir(err)
    return
  }
  console.dir(reply)
}

The reply in the check callback will be the json data parsed from the docparse api server check request. It should look like as follows:

New Bills

var reply = {
  download: true,
  message: 'Bill not yet download. Perform download now.',
  success: true
}

Existing Bills

var reply = {
  download: false,
  message: 'Bill already download. Do not download.',
  success: true
}

Local Cache

You can also pass in an array with the key billNumbers. If your billNumber appears in this array, the system can avoid a remote api call and return results quicker

var billNumbers =
var checkData = {
  supplierCode: 'HES',
  billNumber: 'bar',
  billNumbers: ['foo', 'bar'],
  db: db
}
check(checkData, function(err, reply) {
  if (err) {
    console.dir(err)
  }
  console.dir(reply)
}

Keywords

FAQs

Package last updated on 21 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc