An open API service indexing awesome lists of open source software.

https://github.com/zzarcon/page-ogtags

Get any website OG tags using Puppeteer
https://github.com/zzarcon/page-ogtags

og-tags open-graph page-ogtags puppeteer scraping

Last synced: 16 days ago
JSON representation

Get any website OG tags using Puppeteer

Awesome Lists containing this project

README

          

# page-ogtags
> Get OG tags with ease

# Usage

```javascript
import getMeta from 'page-ogtags';

const {title, description, url, locale, image} = await getMeta('https://www.atlassian.com/');

console.log(
title,
description,
url,
locale.alternate,
image.url,
image.type,
image.width,
);
```

# Features

* Meta property serialization

```html

```

```json
{
"url": "https://www.atlassian.com",
"siteName": "Atlassian",
"fullSiteName": "Atlassian | 2017"
}
```

* Recursive mapping of tags into nested objects:

```html

```

```json
{
"image": {
"value": "https://wac-cdn.atlassian.com/dam/jcr:c20cf6d1-9568-4aba-9a16-dba24e1495de/Atlassian-blue-onecolor@2x-rgb.png",
"width": "1200",
"height": "630"
},
"video": {
"type": "application/x-shockwave-flash",
"width": "400",
"height": "300"
}
}
```

* Array support

```html

```

```json
{
"image": [
"http://example.com/rock.jpg",
"http://example.com/rock2.jpg"
]
}
```

* Retrieve all ```og:``` tags from the page, officials or not.

# TODO

- [ ] babel-plugin-transform-flow-strip-types