Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
meta-og-scrape
Advanced tools
Readme
meta-og-scrape, (built from OpenGraphJS) builds a JSON object from a web page which follows the Open Graph Protocol. The JavaScript object returned by this library contains important metadata such as the description, image, and title.
npm install meta-og-scrape
global.Promise = require('bluebird');
// Include it
var ogjs = require('meta-og-scrape');
// Pass in a URL
ogjs({ url: 'http://animateme.app' })
.then(function (data) {
console.log(data); // some share data parsed from metatags..
}, function (err) {
console.log('It seems that we have fumbled with an error', err);
});
// Include it
var ogjs = require('meta-og-scrape');
// Pass in a URL
ogjs({ url: 'http://animateme.app' }, function (err, data) {
if (err) {
console.log('It seems that we have fumbled with an error', err);
return;
}
console.log(data); // some share data parsed from metatags..
});
{
title: 'Open Graph protocol',
type: 'website',
url: 'http://ogp.me/',
description: 'The Open Graph protocol enables any web page to become a rich object in a social graph.',
image: [{
url: 'http://ogp.me/logo.png',
type: 'image/png',
width: '300',
height: '300'
}]
}
Property Name | JS Name | Type | Description |
---|---|---|---|
og:title | title | string | title set in og:title, if missing uses the page's title tag |
og:type | type | string | open graph type for the current document |
og:url | url | string | sharable url to content |
og:description | description | string | describes the media/page being shared |
og:determiner | determiner | string | |
og:locale | locale | object | has two properties, `name` which contains the default locale and `alternate` which is an array of strings with additional locales |
og:site_name | siteName | string | |
og:image | image | array | Array of objects Properties: - url (always present) - secureUrl (optional) - width (optional) - height (optional) |
og:video | video | array | Array of objects Properties: - url (always present) - secureUrl (optional) - width (optional) - height (optional) |
og:audio | audio | array | Array of objects Properties: - url (always present) - secureUrl (optional) |
FAQs
Scrape meta, link & open graph tags from the head of document as a JavaScript object (JSON)
The npm package meta-og-scrape receives a total of 303 weekly downloads. As such, meta-og-scrape popularity was classified as not popular.
We found that meta-og-scrape demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.