1.0.4 • Published 5 months ago

@devmehq/open-graph-extractor v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Open Graph Extractor

Build Status NPM version Downloads

A simple tools for scraping Open Graph and Twitter Card info off from html.

API / Cloud Hosted Service

We offer this URL Scrapping & Metadata Service in our Scalable Cloud API Service Offering - You could try it here URL Scrapping & Metadata Service

Self-hosting - installation and usage instructions

Installation

Install the module through YARN:

yarn add @devmehq/open-graph-extractor

Or NPM

npm install @devmehq/open-graph-extractor

Examples

// use your favorite request library, in this example i will use axios to get the html
import axios from "axios";
import { extractOpenGraph } from '@devmehq/open-graph-extractor';
const { data: html } = axios.get('https://ogp.me')
const openGraph = extractOpenGraph(html);

Results JSON

{
  ogTitle: 'Open Graph protocol',
  ogType: 'website',
  ogUrl: 'https://ogp.me/',
  ogDescription: 'The Open Graph protocol enables any web page to become a rich object in a social graph.',
  ogImage: {
    url: 'http://ogp.me/logo.png',
    width: '300',
    height: '300',
    type: 'image/png'
  }
} 

Configuration options

customMetaTags

Here you can define custom meta tags you want to scrape. Default: [].

allMedia

By default, OGS will only send back the first image/video it finds. Default: false.

onlyGetOpenGraphInfo

Only fetch open graph info and don't fall back on anything else. Default: false.

ogImageFallback

Fetch other images if no open graph ones are found. Default: false.

Testing

yarn test

Contributing

Please feel free to open an issue or create a pull request and fix bugs or add features, All contributions are welcome. Thank you!

LICENSE MIT

1.0.5-beta.46

6 months ago

1.0.5-beta.47

6 months ago

1.0.5-beta.48

6 months ago

1.0.5-beta.49

6 months ago

1.0.5-beta.60

5 months ago

1.0.5-beta.61

5 months ago

1.0.5-beta.62

5 months ago

1.0.5-beta.50

6 months ago

1.0.5-beta.51

6 months ago

1.0.5-beta.52

6 months ago

1.0.5-beta.53

6 months ago

1.0.5-beta.54

6 months ago

1.0.5-beta.55

6 months ago

1.0.5-beta.56

6 months ago

1.0.5-beta.57

6 months ago

1.0.5-beta.58

6 months ago

1.0.5-beta.59

6 months ago

1.0.5-beta.45

6 months ago

1.0.5-beta.44

6 months ago

1.0.5-beta.43

6 months ago

1.0.5-beta.42

7 months ago

1.0.5-beta.41

7 months ago

1.0.5-beta.40

7 months ago

1.0.5-beta.39

7 months ago

1.0.5-beta.38

7 months ago

1.0.5-beta.37

7 months ago

1.0.5-beta.36

7 months ago

1.0.5-beta.35

7 months ago

1.0.5-beta.34

7 months ago

1.0.5-beta.31

8 months ago

1.0.5-beta.32

8 months ago

1.0.5-beta.33

8 months ago

1.0.5-beta.30

8 months ago

1.0.5-beta.29

8 months ago

1.0.5-beta.28

8 months ago

1.0.5-beta.27

8 months ago

1.0.5-beta.25

8 months ago

1.0.5-beta.26

8 months ago

1.0.5-beta.24

8 months ago

1.0.5-beta.23

8 months ago

1.0.5-beta.21

8 months ago

1.0.5-beta.22

8 months ago

1.0.5-beta.20

8 months ago

1.0.5-beta.18

8 months ago

1.0.5-beta.19

8 months ago

1.0.5-beta.16

8 months ago

1.0.5-beta.17

8 months ago

1.0.5-beta.13

9 months ago

1.0.5-beta.14

9 months ago

1.0.5-beta.15

8 months ago

1.0.5-beta.12

9 months ago

1.0.5-beta.11

9 months ago

1.0.5-beta.10

9 months ago

1.0.5-beta.9

9 months ago

1.0.5-beta.8

9 months ago

1.0.5-beta.7

9 months ago

1.0.5-beta.5

9 months ago

1.0.5-beta.6

9 months ago

1.0.5-beta.4

9 months ago

1.0.5-beta.3

9 months ago

1.0.5-beta.2

9 months ago

1.0.5-beta.1

9 months ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago