Giter Site home page Giter Site logo

rocktimsaikia / meta-fetcher Goto Github PK

View Code? Open in Web Editor NEW
150.0 8.0 5.0 188 KB

Simple metadata scrapper for node.js

Home Page: https://npm.im/meta-fetcher

TypeScript 83.11% JavaScript 16.89%
url-metadata metadata-scrapper meta-data-fetcher metadata-extractor meta-fetcher meta-data

meta-fetcher's Introduction

meta-fetcher

CI npm

Simple metadata scrapper.

Installation

yarn add meta-fetcher

Usage

import metaFetcher from 'meta-fetcher';

const result = await metaFetcher('https://hoppscotch.io/');

console.log(result);

Output:

{
  "title": "Hoppscotch - Open source API development ecosystem",
  "description": "Helps you create requests faster, saving precious time on development.",
  "image": "https://hoppscotch.io/og.png",
  "url": "https://hoppscotch.io/",
  "siteName": "Hoppscotch",
  "type": "website"
}

API

metaFetcher(input)

Takes one url string as a parameter and returns an object containing the meta-information.

input

type: string
default: 'none'

The url string to be scrapped.

Related

page-scrapper: Node.js scrapper that pulls out all links and images of a given site.

License

2024 MIT ยฉ Rocktim Saikia

meta-fetcher's People

Contributors

rocktimsaikia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meta-fetcher's Issues

change the meta tag name

Hi,
First of all, thank you for this npm package. It actually helps me a lot. While I was working on a project, I have noticed it has a tiny issue when I tried to get og:image from head. Upon researching, I have found that you are trying to find 'meta[name="og:image"]' where I think you should find 'meta[property="og:image"]'.

Simplify the result

Merge the opengraph and opengraph-social properties together into one field as they both come under the same category.

fetch does not wait for JS to execute

some websites will have their meta tags populated by JS. Since we are fetching the HTML contents of the page before JS has been loaded, the meta tags will never be filled

eg. the results of fetching meta tags for https://twitter.com/ManjaroLinux will all be empty strings because the meta tags are loaded by the JS

a way to solve this problem would be to use somthing like Selenium or Puppeteer to wait for the page to load before getting the HTML contents.

This is a major blocker since a lot of websites now use client side rendering and this library does not work in those cases.

Move to Github actions for CI

Currently, we are using Travis for CI integration but it would be nice to move to Github actions now.
PRs are welcome for this one ๐Ÿ‘๐Ÿฝ

Replace jest with ava for testing

Even tho I love ava's simplicity. Ava is still not widely used for ts project. I am still experimenting and putting together a boilerplate for future use. Once ready, I will use Ava in this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.