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
- Host: GitHub
- URL: https://github.com/zzarcon/page-ogtags
- Owner: zzarcon
- License: mit
- Created: 2017-09-01T04:40:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-20T12:04:14.000Z (over 8 years ago)
- Last Synced: 2025-03-17T17:21:29.242Z (about 1 year ago)
- Topics: og-tags, open-graph, page-ogtags, puppeteer, scraping
- Language: JavaScript
- Size: 28.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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