grabberjs

0.0.4 • Public • Published

Grabberjs

To grab web's information and send it to backends

Build Status license npm

Table of Contents

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

$ npm install grabberjs

Then 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

  • key required String Specific key for one data collection.

  • data required String | Number | Object data collection.

report

Report your data collections to backend.

Parameters

  • key String 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

  • plugin Object todo

TODO

  • simple as hell
  • plugin system

License

MIT License © Sid Kwok

Readme

Keywords

none

Package Sidebar

Install

npm i grabberjs

Weekly Downloads

11

Version

0.0.4

License

MIT

Last publish

Collaborators

  • sidkwok1994