Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

open-graph-scraper

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

open-graph-scraper - npm Package Compare versions

Comparing version 3.1.4 to 3.1.5

3

CHANGELOG.md

@@ -0,1 +1,4 @@

### 3.1.5
- Updating lodash to fix vulnerable
### 3.1.4

@@ -2,0 +5,0 @@ - Returns more info on the error occurred when using promises

4

package.json
{
"name": "open-graph-scraper",
"description": "Node.js scraper module for Open Graph and Twitter Card info",
"version": "3.1.4",
"version": "3.1.5",
"license": "MIT",

@@ -25,3 +25,3 @@ "main": "index.js",

"jschardet": "1.6.0",
"lodash": "4.17.4",
"lodash": "4.17.5",
"request": "2.83.0"

@@ -28,0 +28,0 @@ },

@@ -15,3 +15,3 @@ openGraphScraper

### Usage
```
```javascript
const ogs = require('open-graph-scraper');

@@ -27,3 +27,3 @@ const options = {'url': 'http://ogp.me/'};

You can set a timeout flag like... Example four seconds:
```
```javascript
const ogs = require('open-graph-scraper');

@@ -38,3 +38,3 @@ const options = {'url': 'http://ogp.me/', 'timeout': 4000};

You can set custom headers. For example scraping data in a specific language:
```
```javascript
const ogs = require('open-graph-scraper');

@@ -49,3 +49,3 @@ const options = {'url': 'http://ogp.me/', 'headers': { 'accept-language': 'en' }};

You can set a blacklist. For example if you want to black list youtube.com:
```
```javascript
const ogs = require('open-graph-scraper');

@@ -60,3 +60,3 @@ const options = {'url': 'http://ogp.me/', 'blacklist': ['youtube.com']};

Example of setting encoding(default is `null`):
```
```javascript
const ogs = require('open-graph-scraper');

@@ -71,3 +71,3 @@ const options = {'url': 'http://ogp.me/', 'encoding': 'utf8'};

There is also a followAllRedirects(default is `true`) and a maxRedirects(default is `20`) option:
```
```javascript
const ogs = require('open-graph-scraper');

@@ -82,3 +82,3 @@ const options = {'url': 'http://ogp.me/', 'followAllRedirects': true, 'maxRedirects': 20};

If you would like the response of the page you scraped you can grab it as the third param:
```
```javascript
const ogs = require('open-graph-scraper');

@@ -94,3 +94,3 @@ const options = {'url': 'http://ogp.me/', 'timeout': 4000};

Promise Example:
```
```javascript
const ogs = require('open-graph-scraper');

@@ -110,3 +110,3 @@ const options = {'url': 'http://ogp.me/'};

It's possible to pass in an HTML string instead of a URL. There won't be a resonse object.
```
```javascript
const htmlString = /* html string goes here */;

@@ -124,3 +124,3 @@ const ogs = require('open-graph-scraper');

Check the return for a ```success``` flag. If success is set to true, then the url input was valid. Otherwise it will be set to false. The above example will return something like...
```
```javascript
{

@@ -127,0 +127,0 @@ data: {

@@ -371,3 +371,3 @@ 'use strict';

expect(result.requestUrl).to.be('http://www.wemeanbusinesslondon.com/blog/2016/5/10/the-entrepreneur-spiration-series-going-nuts-for-pip-nut');
expect(result.data.ogSiteName).to.be('We Mean Business | London');
expect(result.data.ogSiteName).to.be('WE MEAN BUSINESS | LONDON');
expect(result.data.ogTitle).to.be('The Entrepreneur-spiration Series: Going nuts for Pip & Nut');

@@ -425,3 +425,3 @@ expect(result.data.ogUrl).to.be('http://www.wemeanbusinesslondon.com/blog/2016/5/10/the-entrepreneur-spiration-series-going-nuts-for-pip-nut');

// expect(result.data.ogDescription).to.be('Rick Astley - Never Gonna Give You Up (Official Music Video) - Listen On Spotify: http://smarturl.it/AstleySpotify Download Rick\'s Number 1 album "50" - http...');
expect(result.data.ogType).to.be('video');
expect(result.data.ogType).to.be('video.other');
expect(result.data.twitterCard).to.be('player');

@@ -428,0 +428,0 @@ expect(result.data.twitterSite).to.be.a('string');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc