Skip to content

rheidari/node-web-metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#web-metadata

Retrieve a json object containing metadata from a url. Will return an object consisting of the <title>, url as well as any additional <meta/> information it is able to parse.

Example

Pull metadata from http://leap.it

javascript:

var metadata = require('web-metadata');
var opts = {
  url: 'http://leap.it'
};
metadata(opts, function (err, data) {
  // handle err or data here
  console.log(data.url);
  console.log(data.title);
  console.log(data.contentType);
  console.log(data.meta.description);
  console.log(data.meta['twitter:site']);
});

output:

http://leap.it
Leap.it
text/html; charset=utf-8
Leap.it - a whole new take on search. What are you looking to discover? Try it now!
@leapit

Install

With npm do:

npm install web-metadata

License

MIT

About

Retrieve a json object containing metadata from a url.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published