rog
Retrieve open graph data from passing URL.
Installation
Install rog
and its plugins.
$ npm install rog
$ npm install rog-plugin-title
Usage
const rog = require('rog');
rog('http://google.com', {}, {
title: require('rog-plugin-title')
}).then(data => {
console.log(data.title); // => <meta property="og:title" content="...">
}).catch(error => {
console.error(error);
});
Plugins
rog-plugin-description
: a plugin to analyze<meta property="og:description">
and others.rog-plugin-image
: a plugin to analyze<meta property="og:image">
and others.rog-plugin-images
: a plugin to analyze<img>
s written in<body>
.rog-plugin-locale
: a plugin to analyze<meta property="og:locale">
.rog-plugin-sitename
: a plugin to analyze<meta property="og:site_name">
and others.rog-plugin-title
: a plugin to analyze<meta property="og:title">
and others.rog-plugin-type
: a plugin to analyze<meta property="og:type">
.rog-plugin-url
: a plugin to analyze<meta property="og:url">
and others.