Skip to content
cathcheenoPublic
forked from 1000ch/rog

About

Retrieve open graph data from passing URL.

Resources

Stars

0 stars

Watchers

1 watching

Forks

 
 

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rog Build Status Dependency Status

Retrieve open graph data from passing URL.

Installation

$ npm i rog

Usage

const rog = require('rog');

rog('http://google.com').then(data => {
  console.log(data.title);       // => <meta property="og:title" content="...">
  console.log(data.type);        // => <meta property="og:type" content="...">
  console.log(data.url);         // => <meta property="og:url" content="...">
  console.log(data.image);       // => <meta property="og:image" content="...">
  console.log(data.site);        // => <meta property="og:site" content="...">
  console.log(data.description); // => <meta property="og:description" content="...">
  console.log(data.locale);      // => <meta property="og:locale" content="...">
}).catch(error => {
  console.error(error);
});

It will retrieve alternative data if <meta property="og:..."> does not exist. For example, if <meta property="og:url" content="..."> does not exist, it will retrieve <meta name="twitter:url"> or <link rel="canonical">.

License

MIT: http://1000ch.mit-license.org

About

Retrieve open graph data from passing URL.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages