From 81d49c8e69d86396a8fd679bcdfd4d7ec7454c6f Mon Sep 17 00:00:00 2001 From: XeonCore Date: Sun, 12 Oct 2014 12:38:38 +1100 Subject: [PATCH] Pull description information from meta tags Tries to extract a description from the page by looking at meta and og description tags --- src/plugins/irc-events/link.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 8540281..8ee4b93 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -63,7 +63,8 @@ function parse(msg, url, res, client) { var $ = cheerio.load(res.res.text); toggle.type = "link"; toggle.head = $("title").text(); - toggle.body = "No description found."; + toggle.body = $('meta[name=description]').attr('content') || + $('meta[property="og:description"]').attr('content') || ""; break; case "image/png":