Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Twitter Before/After
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);

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.
Twitter should implement ISO/Unix time in the individual tweet view.


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