Git Product home page Git Product logo

page-previewer's Introduction

page-previewer

Simple web page scraper which returns basic preview info like title, description, images, videos using request and cheerio modules.

Install

	npm install page-previewer

How to use

var preview = require("page-previewer");
preview("http://www.google.com", function(err, data) {
	if(!err) {
		console.log(data); //Prints the meta data about the page 
	}
});

You can set a proxy server too

var preview = require("page-previewer");
preview({ url: "http://www.google.com", proxy: "{server name}", function(err, data) {
	if(!err) {
		console.log(data); //Prints the meta data about the page 
	}
});

returns

{ url: 'http://www.google.com',
  loadFailed: false,
  title: 'Google',
  description: 'Search the world\'s information, including webpages, images, videos and more. Google has many special features to help you find exactly what you\'re looking for.',
  contentType: 'text/html',
  mediaType: 'website',
  images: [ 'http://www.google.com/intl/en_ALL/images/srpr/logo1w.png' ],
  videos: undefined,
  audios: undefined }

page-previewer's People

Contributors

bouchja1 avatar iahvector avatar mamalat avatar robby avatar rokoroku avatar snatesan avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.