0.1.0 • Published 9 years ago

get-page v0.1.0

Weekly downloads
2
License
CC0
Repository
github
Last release
9 years ago

Get Page

Clean HTTP requests to scrap internet pages

Dependency
Status

Installation

$ npm install get-page --save

Usage

Getting the page as a String:

// Getting pages as string
var getPage = require('get-page').string;

getPage('https://github.com/', function(page) {
  console.log(page);
});

// <!DOCTYPE html>
// <html lang="en" class="">
// ...

Getting binary data as a Buffer:

// Getting pages as string
var getPage = require('get-page').buffer;

getPage('https://s.gravatar.com/avatar/09024b63299b12abce833b772a7a3015?s=80', function(image) {
  console.log(image);
});

// <Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d ... >

License

This code is released under CC0 (Public Domain)