Popularity
0.3
-
Activity
4.3
-
6
1
0

Description

Meta Fetcher is a tiny node module that fetches a websites meta data through a given URL.

Monthly Downloads: 0
Programming language: TypeScript
Tags: Nodejs     Utilities     Node     Module     NPM    
Latest version: v1.0.1

meta-fetcher ๐Ÿ”Ž alternatives and similar modules

Based on the "Utilities" category

Do you think we are missing an alternative of meta-fetcher ๐Ÿ”Ž or a related project?

Add another 'Utilities' Module

README

meta-fetcher :mag_right:

Tiny URL meta-data fetcher that scraps the meta-data of a given URL string.

Travis (.com) branch XO code style

Under the hood it uses node-fetch to fetch the metadata, parses it and returns it as json object.

Install

npm install meta-fetcher

Basic Usage

const {fetchMetaData} = require('meta-fetcher');

(async () => {
    const result = await fetchMetaData('https://hoppscotch.io/');
    console.log(result);

    /*
        {
        basic_metadata: {
            website: 'https://hoppscotch.io/',
            title: 'Hoppscotch โ€ข A free, fast and beautiful API request builder',
            description: 'A free, fast and beautiful API request builder'
        },
        opengraph: {
            'og:image': 'https://hoppscotch.io/banner.jpg',
            'og:type': 'website',
            'og:title': 'Hoppscotch',
            'og:site_name': 'Hoppscotch',
            'og:description': 'A free, fast and beautiful API request builder',
            'og:url': 'https://hoppscotch.io/'
        },
        opengraph_social: {
            'twitter:card': 'summary_large_image',
            'twitter:site': '@liyasthomas',
            'twitter:creator': '@liyasthomas'
        },
        favicons: [
            'https://hoppscotch.io/icon.png',
            'https://hoppscotch.io/icon.png',
            'https://hoppscotch.io/_nuxt/icons/icon_64x64.9834b3.png'
        ]
        }
    */ 
})();

Advanced Usage (with options)

You can optionally set the userAgent and fromEmail options in request Header while fetching the meta-data.

const {fetchMetaData} = require('meta-fetcher');

(async () => {
    const result = await fetchMetaData('https://hoppscotch.io/', {
        userAgent: 'Rocktim',
        fromEmail: 'srocktim61@gmail.com'
    });
    console.log(result);
})();

It can also fetch meta-data from shortened-url .For example:

const {fetchMetaData} = require('meta-fetcher');

(async () => {
    const result = await fetchMetaData('https://bit.ly/2Fj9sNF');
    console.log(result);
})();

Options

You can set these options in Header while fetching the data if needed.

Option Required Default Value
userAgent No meta-fetcher
fromEMail No metafetch@email.com

API

metaDataFetch(url, options)

url

Type: string url string that you want to fetch the meta-data from.

options

Type: object Optional Header paramerter you can set if needed.

Contribute

For any new feature request or bug report, please open an issue or pull request in GitHub.

License

MIT © Rocktim Saikia


*Note that all licence references and agreements mentioned in the meta-fetcher ๐Ÿ”Ž README section above are relevant to that project's source code only.