@5app/opengraph-scraper 中文文档教程
Opengraph Scraper
给定一个 URL 将返回有关该页面的元信息。
例如
用法:
// Import
const opengraphScraper = require('@5app/opengraph-scraper');
// Set a timeout in ms
const timeout = 3000;
// Url
const url = 'https://twitter.com/';
// Returns object
const {title, description} = await opengraphScraper(url, timeout);
console.log('Title: ', title, '- Description: ', description);
// Title:
Opengraph Scraper
Given a URL will return meta information about the page.
e.g.
Usage:
// Import
const opengraphScraper = require('@5app/opengraph-scraper');
// Set a timeout in ms
const timeout = 3000;
// Url
const url = 'https://twitter.com/';
// Returns object
const {title, description} = await opengraphScraper(url, timeout);
console.log('Title: ', title, '- Description: ', description);
// Title: