hitode909 (owner)

Revisions

gist: 145317 Download_button fork
public
Public Clone URL: git://gist.github.com/145317.git
Embed All Files: show embed
useful.user.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// ==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));
         }
     );
                         
 }());