hydra-page-previewer

    0.2.1 • Public • Published

    hydra-page-previewer

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

    This fork of page-previewer is maintained by Gab AI, Inc.

    Changes

    The following changes have been made to the module since forking.

    v0.1.14

    • fix processing of videoType if null

    v0.1.13

    • title processing fixes

    v0.1.12

    • validate presence of body

    v0.1.11

    • fix in getTitle() title element processing

    v0.1.10

    • fix in page parsing for Content-Type

    v0.1.9

    • getResponseEncoding() added to help determine proper encoding to use for body

    v0.1.5

    • Fix page title logic

    v0.1.3

    • Updated request from v2.12.0 to v2.88.0 to address a security concern
    • Accept full request options
    • 'use strict'
    • Code cleanup

    Install

    npm install hydra-page-previewer
    

    How to use

    var preview = require("hydra-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("hydra-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 }

    Install

    npm i hydra-page-previewer

    DownloadsWeekly Downloads

    17

    Version

    0.2.1

    License

    Apache-2.0

    Unpacked Size

    773 kB

    Total Files

    9

    Last publish

    Collaborators

    • robcolbert