-
-
Save cef62/b18eba742ab18936543f993ad586b412 to your computer and use it in GitHub Desktop.
Tweet Presenter!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste this to chrome console on anybody's twitter page | |
// and it'll turn into an instant presentation :) | |
(function TweetPresent() { | |
const presenter = $(`<div id="tpd" style=" position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; padding: 10vh 10vw; box-sizing: border-box; background-color: white; font-size: 5vw; text-align: center; z-index: 9999; display: flex; align-items: center; justify-content: center;"></div>`); | |
const tweets = $$(`div.tweet p.js-tweet-text`) | |
.map(el => el.innerHTML) | |
.map(t => ({t, s: Math.random()})) | |
.sort((a, b) => a.s > b.s ? -1 : 1) | |
.map(c => c.t); | |
$('div#tpd').remove(); | |
$('body').append(presenter); | |
const present = tweet => presenter.html($('<div />').html(tweet)); | |
presenter.on('click', () => present(tweets.pop())); | |
present(tweets.pop()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment