Skip to content

Instantly share code, notes, and snippets.

@BaseCase
Last active September 30, 2015 14:17
Show Gist options
  • Select an option

  • Save BaseCase/1805089 to your computer and use it in GitHub Desktop.

Select an option

Save BaseCase/1805089 to your computer and use it in GitHub Desktop.
Make it obvious which tweet is last read, and make enter key load new tweets.
var adjust_twitter_view = function () {
//reset colors
$('li.stream-item').css('background','#fff');
//highlight most recent tweet to make it easier to visually ID the new ones
$('li.stream-item').first().css('background','#dedede');
};
adjust_twitter_view();
//attach behavior to the "new tweets" button
$('div.new-tweets-bar').live('click', function(e) {
setTimeout(function() {
adjust_twitter_view();
}, 8000);
});
$('body').keydown(function(e) {
if (e.which == 13) { //add a keyboard shortcut to the load new tweets bar
$('div.new-tweets-bar').click();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment