Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Parse a html page and output via a template

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 node_modules
Octocat-spinner-32 test
Octocat-spinner-32 LICENCE
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

Content Mapper

Take content from one file, or url, and map it to another via a template.

Usage

Simple example:

Grab the top headline from Reddit and put it into a message.

`var contentUrl = "http://www.reddit.com";
var mappingFcn = function($){
return { headline: $('.content .spacer:last .entry:first a:first').text() };
};
var templateFcn = function(){
return "Top Reddit headline: <%= headline %>!";
};

contentMapper(contentUrl, {
mappingFn: mappingFcn,
template: templateFcn
},function(err,res){ console.log(res); });
`

Install

npm install contentmapper

Something went wrong with that request. Please try again.