Skip to content

Instantly share code, notes, and snippets.

View Deamoner's full-sized avatar

Matt Davis Deamoner

View GitHub Profile
@Deamoner
Deamoner / gist:bb2fb62248d955b11c1c64113a4b9090
Created January 5, 2023 03:30
nodejs function to get all the social meta data of a url
const request = require('request');
const cheerio = require('cheerio');
function getSocialMetaData(url) {
request(url, (error, response, html) => {
if (!error && response.statusCode === 200) {
const $ = cheerio.load(html);
const title = $('title').text();
const description = $('meta[name="description"]').attr('content');