medium

A small coffeescript module that uses Request and Cheerio to parse metadata from a URL.

npm install medium
4 downloads in the last month

Medium

Medium is just a little module written in coffeescript using Request and Cheerio to parse metadata from a URL.

Note: The test file is currently empty, although the moudule will be soon unit-tested

Build Status

Setup

npm install medium

Usage

var medium = require('medium');

medium.getData('http://www.google.com/', function (err, data) {
    if (err !== null) {
        // Handle error
    } else {
        console.log(data);
    }
});

Exported functions

getData (url, callback)

url (String) Must be a valid URL callback (Function) Use like function (err, data) when executed.

The returned data (Object) will contain url (String), title (String), images (Array), description (String)

The data return is only a best guess based on the DOM structure returned by the request. Will error in case of a failed connection or in case no data was found.

npm loves you