Fetch max 1 link per message
This commit is contained in:
parent
4fcd21ccff
commit
67f6e526f2
|
@ -652,6 +652,9 @@ button {
|
||||||
}
|
}
|
||||||
#chat .toggle-content .body {
|
#chat .toggle-content .body {
|
||||||
color: #999;
|
color: #999;
|
||||||
|
max-width: 460px;
|
||||||
|
word-break: normal;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
#chat .toggle-content.show {
|
#chat .toggle-content.show {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
|
|
|
@ -11,7 +11,7 @@ module.exports = function(irc, network) {
|
||||||
if (!config.prefetch) {
|
if (!config.prefetch) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var links = [];
|
var links = [];
|
||||||
var split = data.message.split(" ");
|
var split = data.message.split(" ");
|
||||||
_.each(split, function(w) {
|
_.each(split, function(w) {
|
||||||
|
@ -41,10 +41,9 @@ module.exports = function(irc, network) {
|
||||||
msg: msg
|
msg: msg
|
||||||
});
|
});
|
||||||
|
|
||||||
_.each(links, function(url) {
|
var link = links[0];
|
||||||
fetch(url, function(res) {
|
fetch(link, function(res) {
|
||||||
parse(msg, url, res, client);
|
parse(msg, link, res, client);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -68,7 +67,7 @@ function parse(msg, url, res, client) {
|
||||||
$('meta[name=description]').attr('content')
|
$('meta[name=description]').attr('content')
|
||||||
|| $('meta[property="og:description"]').attr('content')
|
|| $('meta[property="og:description"]').attr('content')
|
||||||
|| "No description found.";
|
|| "No description found.";
|
||||||
toggle.thumb =
|
toggle.thumb =
|
||||||
$('meta[property="og:image"]').attr('content')
|
$('meta[property="og:image"]').attr('content')
|
||||||
|| $('meta[name="twitter:image:src"]').attr('content')
|
|| $('meta[name="twitter:image:src"]').attr('content')
|
||||||
|| "";
|
|| "";
|
||||||
|
|
Loading…
Reference in New Issue