Skip to content

Instantly share code, notes, and snippets.

@mknepprath
Created February 11, 2020 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mknepprath/e8543f516d345637745bf53fb4fea3fd to your computer and use it in GitHub Desktop.
Save mknepprath/e8543f516d345637745bf53fb4fea3fd to your computer and use it in GitHub Desktop.
Get a list of tweet IDs.
const hrefs = [];
setInterval(function() {
const timestamps = [...document.getElementsByTagName("time")];
timestamps.forEach(timestamp => {
if (timestamp.parentNode.href) {
const tweetId = timestamp.parentNode.href.split("/").pop();
hrefs.push(tweetId);
};
});
window.scrollTo(
0,
document.body.scrollHeight || document.documentElement.scrollHeight
);
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment