Retrieve open graph data by passing URL.
Install rog
and its plugins.
$ npm install rog
$ npm install rog-plugin-title
import {rog} from 'rog';
import {rogTitle} from 'rog-plugin-title';
rog('http://google.com', {
title: rogTitle
}).then(data => {
console.log(data.title); // => <meta property="og:title" content="...">
}).catch(error => {
console.error(error);
});
rog
: core packagerog-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.