I often put twitter urls in my inbox and then forget what it was about. Instead of having to open each URL separately, I wrote a little tampermonkey script that embeds the tweet.
// ==UserScript==
// @name Dynalist Tweet preview
// @namespace http://louiskirsch.com/
// @version 0.1
// @description Resolves twitter links and displays them as tweets inline
// @author Louis Kirsch
// @match https://dynalist.io/d/*
// @grant GM.xmlHttpRequest
// @run-at document-idle
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// ==/UserScript==
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "https://platform.twitter.com/widgets.js";
s.async = true;
document.head.append(s);
waitForKeyElements("a.node-link[href^='https://twitter.com/", actionFunction, false);
function actionFunction(links) {
links.each((i, l) => {
var requestUrl = 'https://publish.twitter.com/oembed?omit_script=1&url=' + l.href;
GM.xmlHttpRequest({
method: "GET",
url: requestUrl,
onload: function(response) {
var data = JSON.parse(response.responseText);
$(l).after(data.html);
if (twttr.widgets != undefined) {
twttr.widgets.load();
}
}
});
});
}