Pull description information from meta tags

Tries to extract a description from the page by looking at meta and og description tags
This commit is contained in:
XeonCore 2014-10-12 12:38:38 +11:00
parent 40f8a4ddc4
commit 81d49c8e69

View File

@ -63,7 +63,8 @@ function parse(msg, url, res, client) {
var $ = cheerio.load(res.res.text); var $ = cheerio.load(res.res.text);
toggle.type = "link"; toggle.type = "link";
toggle.head = $("title").text(); toggle.head = $("title").text();
toggle.body = "No description found."; toggle.body = $('meta[name=description]').attr('content') ||
$('meta[property="og:description"]').attr('content') || "";
break; break;
case "image/png": case "image/png":