Skip to content

Instantly share code, notes, and snippets.

@hitode909
Created July 11, 2009 17:16
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 hitode909/145317 to your computer and use it in GitHub Desktop.
Save hitode909/145317 to your computer and use it in GitHub Desktop.
// ==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