Created
March 14, 2011 07:36
-
-
Save dolpen/868879 to your computer and use it in GitHub Desktop.
(最終更新11/04/30)対象ページの仕様に変更があった場合や、うまく動かなくなった場合は適切にメンテしてください。あるいは私(@dolpen)に連絡を。 機能追加版(こちらをforkするといいと思います):https://gist.github.com/870547
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name de-duplication | |
| // @namespace http://www.dolpen.net/ | |
| // @description find duplicated tweet | |
| // @include http://www.sinsai.info/ushahidi/index.php/admin/messages/index/3* | |
| // @include http://www.sinsai.info/ushahidi/admin/messages/index/3* | |
| // @include http://manager.sinsai.info/ushahidi/admin/messages/index/3* | |
| // @require http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js | |
| // ==/UserScript== | |
| (function(){ | |
| var strs=[]; | |
| var flags=[]; | |
| var found=0; | |
| var objs=$('div.post'); | |
| objs.each(function(){ | |
| strs.push($.trim($(this).text())); | |
| flags.push(true); | |
| }); | |
| for(i=strs.length-1;i>=0;i--){ | |
| var temp=strs[i]; | |
| var t=false; | |
| if(!flags[i])continue; | |
| for(j=0;j<i;j++){ | |
| if(strs[j]==temp){ | |
| found++; | |
| objs.eq(j).css('background','#bbbbff'); | |
| objs.eq(j).parent().parent().find('input').attr('checked',true); | |
| flags[j]=false; | |
| t=true; | |
| } | |
| } | |
| if(t){ | |
| objs.eq(i).css('background','#ffbbbb'); | |
| }else{ | |
| objs.eq(i).parent().parent().css('display','none'); | |
| } | |
| } | |
| $('th.col-1').append($('<span></span>').text('('+found+')')); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment