in Tech

New Twitter Last Read Tweet Bar Bookmarklet

Update: Twitter has now added this to the site and the bookmarklet below is no longer of any use.

Got the new Twitter?
Annoyed that when you click the bar that says ‘x new tweets’ you can’t find the last one you had already read?
Harry Bailey to the rescue.

Update: Now works in Chrome, Safari, Firefox. Anyone checked Internet Explorer?

Drag the following link to your bookmark bar, go to the Twitter page that’s annoying you, click the bookmarklet:

‘);setInterval(function(){var last_read = $(‘div.stream-item.last-read’);if(!last_read.length){$(‘div.stream-item:first’).addClass(‘last-read’);}else if(last_read.prev().length){$(‘div.stream-item.marker’).removeClass(‘marker’).removeAttr(‘style’);last_read.removeClass(‘last-read’).addClass(‘marker’);$(‘div.stream-item:first’).addClass(‘last-read’);}}, 2000);})()”>Twitter Last Read Bar

Now when you click the ‘x more tweets’ link you will see a dark bar just above the last tweet you had previously read.

Lets hope Twitter add this as a standard feature soon!

If you are interested in the actual javascript used (let me know if you improve it) then here you go:

(function(){
$('head').append('');
setInterval(function()
{
	var last_read = $('div.stream-item.last-read');
	if(!last_read.length)
	{
		$('div.stream-item:first').addClass('last-read');
	}
	else if(last_read.prev().length)
	{
		$('div.stream-item.marker').removeClass('marker').removeAttr('style');
		last_read.removeClass('last-read').addClass('marker');
		$('div.stream-item:first').addClass('last-read');
	}
}, 2000);
}();

Comments are closed.