Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Twitter Before/After
(function(){
let name = location.href.match(/twitter\.com\/([^/]+)\//)[1];
let match = document.querySelector('a[href$="#source-labels"]').parentNode.firstElementChild.textContent.match(/([0-9]+)([0-9]+)([0-9]+)/);
let date = new Date(`${match[1]}-${match[2]}-${match[3]}`) - 0, since = new Date(date - 1000*60*60*24).toISOString().substr(0,10), until = new Date(date + 1000*60*60*24).toISOString().substr(0,10);
location.assign(`https://twitter.com/search?q=from%3A${name}%20since%3A${since}%20until%3A${until}&f=live`);
})();
@knoajp

This comment has been minimized.

Copy link
Owner Author

@knoajp knoajp commented Jul 9, 2020

It's for Japanese locale only, but you can customize the regexp and so on.
https://twitter.com/kantankikaku/status/1277445534207209472
Twitter should implement ISO/Unix time in the individual tweet view.
https://twitter.com/kantankikaku/status/1277434626043084800

日本語でしか動きませんが、正規表現などのカスタマイズは可能です。
https://twitter.com/kantankikaku/status/1277445534207209472
Twitterは個別ツイート画面にISO/Unix時刻を埋め込むべき。
https://twitter.com/kantankikaku/status/1277434626043084800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment