Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Grabity looks through Open Graph and Twitter Cards markup to get Information about a link. It's functions will return as much data as they can from the markup. If no og or twitter tags are found, the returned objects will be empty.
npm install grabity
It's really quite simple:
let grabity = require("grabity");
(async () => {
let it = await grabity.grabIt("https://github.com/e-oj/grabity");
console.log(it);
})();
Should produce:
{
title: 'e-oj/grabity',
description: 'grabity - Get preview data from a link. Just grab it! 🎣',
image: 'https://avatars0.githubusercontent.com/u/9700116?s=400&v=4'
}
url (required): url to be used
returns: object containing title, description and image if found
Gets the og or twitter title, description and image from a url and returns them in an object. If og and twitter tags exist for a property, the og tag is given preference. The twitter tag is selected if an og tag does not exist for a property. If there is no tag (og or twitter) for a property, that property is not included in the returned object.
let grabity = require("grabity");
(async () => {
let it = await grabity.grabIt("https://www.flickr.com");
console.log(it);
})();
result:
{
title: 'Flickr, a Yahoo company',
description: 'Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to the world, securely and privately show content to your friends and family, or blog the photos and videos you take with a cameraphone.',
image: 'https://farm4.staticflickr.com/3914/15118079089_489aa62638_b.jpg'
}
url (required): url to be used
returns: object containing all found og + twitter tags and values
Gets all existing og and twitter tags from the markup and returns them in an object.
let grabity = require("grabity");
(async () => {
let tags = await grabity.grab("https://www.flickr.com");
console.log(tags);
})();
result:
{
'og:site_name': 'Flickr',
'og:updated_time': '2017-11-19T21:29:36.577Z',
'og:title': 'Flickr, a Yahoo company',
'og:type': 'website',
'og:description': 'Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to the world, securely and privately show content to your friends and family, or blog the photos and videos you take with a cameraphone.',
'og:image': 'https://farm4.staticflickr.com/3914/15118079089_489aa62638_b.jpg',
'twitter:card': 'summary_large_image',
'twitter:creator': '@flickr',
'twitter:title': 'Flickr, a Yahoo company',
'twitter:description': 'Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to the world, securely and privately show content to your friends and family, or blog the photos and videos you take with a cameraphone.',
'twitter:image:src': 'https://farm4.staticflickr.com/3914/15118079089_489aa62638_b.jpg'
}
To test this module, cd to the project directory and run:
npm run-script test-server
then in a seperate terminal:
npm test
Note: The test server runs on port 9973 by default. You can change the port number in test_setup/config.js
FAQs
Get preview data from a link. Just grab it.
The npm package grabity receives a total of 103 weekly downloads. As such, grabity popularity was classified as not popular.
We found that grabity 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.