All Projects → brahma-dev → metafetch

brahma-dev / metafetch

Licence: MIT License
NodeJS package that fetches a given URL's title, description, images, links etc.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to metafetch

Unfurl
Scraper for oEmbed, Twitter Cards and Open Graph metadata - fast and Promise-based ⚡️
Stars: ✭ 193 (+819.05%)
Mutual labels:  scraper, meta-tags
gochanges
**[ARCHIVED]** website changes tracker 🔍
Stars: ✭ 12 (-42.86%)
Mutual labels:  scraper, scraping-websites
Ferret
Declarative web scraping
Stars: ✭ 4,837 (+22933.33%)
Mutual labels:  scraper, scraping-websites
kick-off-web-scraping-python-selenium-beautifulsoup
A tutorial-based introduction to web scraping with Python.
Stars: ✭ 18 (-14.29%)
Mutual labels:  scraper, scraping-websites
proxycrawl-python
ProxyCrawl Python library for scraping and crawling
Stars: ✭ 51 (+142.86%)
Mutual labels:  scraper, scraping-websites
scrapman
Retrieve real (with Javascript executed) HTML code from an URL, ultra fast and supports multiple parallel loading of webs
Stars: ✭ 21 (+0%)
Mutual labels:  scraper, scraping-websites
TradeTheEvent
Implementation of "Trade the Event: Corporate Events Detection for News-Based Event-Driven Trading." In Findings of ACL2021
Stars: ✭ 64 (+204.76%)
Mutual labels:  scraper, scraping-websites
imdb-scraper
🎬 An attempt at the most complete IMDb API
Stars: ✭ 24 (+14.29%)
Mutual labels:  scraper, scraping-websites
Instagram-to-discord
Monitor instagram user account and automatically post new images to discord channel via a webhook. Working 2022!
Stars: ✭ 113 (+438.1%)
Mutual labels:  scraper, scraping-websites
LeetCode
At present contains scraped data from around 1500 problems present on the site. More to follow....
Stars: ✭ 45 (+114.29%)
Mutual labels:  scraper, scraping-websites
OLX Scraper
📻 An OLX Scraper using Scrapy + MongoDB. It Scrapes recent ads posted regarding requested product and dumps to NOSQL MONGODB.
Stars: ✭ 15 (-28.57%)
Mutual labels:  scraper, scraping-websites
document-dl
Command line program to download documents from web portals.
Stars: ✭ 14 (-33.33%)
Mutual labels:  scraper, scraping-websites
AzurLaneWikiScrapers
A console application that can scrape the Azur Lane wiki and export the data to Json files
Stars: ✭ 12 (-42.86%)
Mutual labels:  scraper
peeling-onions
A repository to store Deep Web (onion domain) crawler, scraper, and NLP tools for Tor network.
Stars: ✭ 18 (-14.29%)
Mutual labels:  scraper
Instagram-Comments-Scraper
Instagram comment scraper using python and selenium. Save the comments into excel.
Stars: ✭ 73 (+247.62%)
Mutual labels:  scraper
awesome-interface
AngularJS SPA interface for awesome lists. Awesome lists parsed using python.
Stars: ✭ 25 (+19.05%)
Mutual labels:  scraper
metacritic api
PHP Metacritic API - Mirrored by my GitLab
Stars: ✭ 31 (+47.62%)
Mutual labels:  scraper
html-meta-tags
Generate HTML meta tags from JSON data.
Stars: ✭ 27 (+28.57%)
Mutual labels:  meta-tags
newsemble
API for fetching data from news websites.
Stars: ✭ 42 (+100%)
Mutual labels:  scraper
opensea-scraper
Scrapes nft floor prices and additional information from opensea. Used for https://nftfloorprice.info
Stars: ✭ 129 (+514.29%)
Mutual labels:  scraper

Node metafetch

Build Status Coverage Coverage Known Vulnerabilities

NPM

Metafetch fetches a given URL's title, description, images, links etc.

Installation

Use NPM to install:

npm install metafetch

Usage

var metafetch = require('metafetch');

metafetch.fetch('http://www.facebook.com'[, options], function(err, meta) {
    console.log('title: ', meta.title);
    console.log('description: ', meta.description);
    console.log('type: ', meta.type);
    console.log('url: ', meta.url);
    console.log('ampURL: ', meta.ampURL);
    console.log('siteName: ', meta.siteName);
    console.log('charset: ', meta.charset);
    console.log('image: ', meta.image);
    console.log('meta: ', meta.meta);
    console.log('images: ', meta.images);
    console.log('links: ', meta.links);
    console.log('headers: ', meta.headers);
    console.log('language: ', meta.language);
});

Or using Promise

metafetch.fetch('http://www.facebook.com'[, options]).then(function(meta) {
    console.log('title: ', meta.title);
    console.log('description: ', meta.description);
    console.log('type: ', meta.type);
    console.log('url: ', meta.url);
    console.log('ampURL: ', meta.ampURL);
    console.log('siteName: ', meta.siteName);
    console.log('charset: ', meta.charset);
    console.log('image: ', meta.image);
    console.log('meta: ', meta.meta);
    console.log('images: ', meta.images);
    console.log('links: ', meta.links);
    console.log('headers: ', meta.headers);
    console.log('language: ', meta.language);
}).catch(console.error);

Optional flags to disable parsing images and links and http timeout or headers

metafetch.fetch('http://www.facebook.com', { 
    userAgent: "User Agent/Defaults to Firefox 58",
    flags: { 
        images: false,
        links: false,
        language: false
    },
    http: {
        timeout: 30000,
        headers: {
            Accept: "*/*"
        }
    }
}, function(err, meta) {
    console.log('title: ', meta.title);
    console.log('description: ', meta.description);
    console.log('type: ', meta.type);
    console.log('url: ', meta.url);
    console.log('ampURL: ', meta.ampURL);
    console.log('siteName: ', meta.siteName);
    console.log('charset: ', meta.charset);
    console.log('image: ', meta.image);
    console.log('meta: ', meta.meta);
    console.log('headers: ', meta.headers);
    console.log('language: ', meta.language);
});

Set User Agent across instance

metafetch.setUserAgent("PersonalBot");

Response Data

  • title : Page title or og:title meta tag.
  • description : Page description or og:description meta tag.
  • image : og:image meta tag.
  • url : Page url or og:url meta tag.
  • ampURL : URL from amphtml tag or null.
  • uri : Page uri object, parsed by uri-js.
  • images : All images on this page.
  • links : All links on this page.
  • meta : All the meta tags that with a property or name attribute. e.g <meta property="author" content="Example">, <meta name="description" content="Example.">
  • headers : HTTP headers, lowercasing field names much like node does.
  • language : Content language (ISO 639-1) based on meta data/headers, falling back to detection by franc.

License

(The MIT License)

Copyright (c) 2017 Brahma Dev;

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].