Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==UserScript==
// @name useful
// @namespace http://www.hatena.ne.jp/hitode909/
// @description useful
// @include http://twitter.com/*
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function(){
GM_registerMenuCommand('useful - clear cache', function () {
GM_setValue('read_posts', '{}');
$('li.status').show('slow');
});
var read_posts = eval(GM_getValue('read_posts'));
if (typeof(read_posts) == 'undefined'){
read_posts = {};
}
var posts = $('li.status');
console.log(posts.length);
// 前に消したやつを消す
for (var k in read_posts) if (read_posts.hasOwnProperty(k)) {
$('li.status#'+k).hide();
}
// 消す
var setvalue = function(v){GM_setValue('read_posts',v)};
posts.mouseover(
function(){
$(this).hide('fast');
read_posts[this.id] = true;
setvalue(uneval(read_posts));
}
);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment