0.0.4 • Published 9 years ago
grabberjs v0.0.4
Grabberjs
To grab web's information and send it to backends
Table of Contents
Install
This project uses node and npm. Go check them out if you don't have them locally installed.
$ npm install grabberjsThen with a module bundler like rollup or webpack, use as you would anything else:
// using ES6 modules
import Grabber from 'grabberjs'
// using CommonJS modules
var Grabber = require('grabberjs')The UMD build is also available on unpkg:
<script src="https://unpkg.com/grabberjs/dist/grabber.min.js"></script>You can find the library on window.Grabber.
Usage
setup in your app
import Grabber from 'grabberjs';
const { grab, report } = new Grabber({
url: 'https://example.com'
});
// grab whatever you want
grab(
'example',
'str',
// 123,
// {obj: 'object'}
);
// report them in a perfect timing
report();setup in your backend
// TODO:API
grab
Grab data.
Parameters
keyrequired String Specific key for one data collection.datarequired String | Number | Object data collection.
report
Report your data collections to backend.
Parameters
keyString Specific key for one data collection. If it is missing, Grabber will all your data collections to backend.
use
Install a plugin for your Grabber.
Parameters
pluginObject todo
TODO
- simple as hell
- plugin system