個人用

    @@ -1,54 +1,12 @@ /* - * @title クリック数をグラフで見る - * @description クリック数をグラフで見る + * @title 個人用 + * @description 個人用 * @include http://* * @license MIT License * @require */ -var parentEl = document.getElementById('bookmarked_user'); -var nodes = parentEl.childNodes; - -var ElementInfo = function(el, count, username) { - this.el = el; - this.count = count; - this.username = username; -}; - -var totalCount = 0; -var elList = []; -for (var i = 0, l = nodes.length; i < l; i++) { - var el = nodes[i]; - if (el.nodeType === 1) { - var usernameEl = Ten.DOM.getElementsByClassName('username', el)[0]; - var countEl = Ten.DOM.getElementsByClassName('click-count', el)[0]; - if (countEl) { - var username = usernameEl.innerText || usernameEl.textContent; - var count = countEl.innerText || countEl.textContent; - var m = count.match(/\d+/); - count = +m[0]; - elList.push(new ElementInfo(el, count, username)); - totalCount += count; - } - } -} - -elList = elList.sort(function(a, b) { return b.count - a.count }); - -var otherCount = 0; -var labelList = []; -var dataList = []; -for (var i = 0; i < elList.length; i++) { - if (elList[i].count / totalCount < 0.01) { - otherCount += elList[i].count; - } - else { - labelList.push(elList[i].username + ' (' + elList[i].count + ') ' + Math.floor(elList[i].count / totalCount * 1000) / 10 + '%'); - dataList.push(elList[i].count / totalCount); - } -} - -labelList.push('other ' + ' (' + otherCount + ') ' + Math.floor(otherCount / totalCount * 1000) / 10 + '%'); -dataList.push(otherCount / totalCount); - -location.href = 'http://chart.apis.google.com/chart?cht=p&chd=t:' + dataList.join(',') + '&chs=600x200&chl=' + labelList.join('|') +var list = $$('li[userid] a[onclick]').filter(function(e) { return e.parentNode.className != 'disabled' }); +var i = 0; +setInterval(function() { var e = document.createEvent('MouseEvent'); +e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); list[i].dispatchEvent(e); i++ }, 10000);
  • /*
     * @title 個人用
     * @description 個人用
     * @include http://*
     * @license MIT License
     * @require 
     */
    
    var list = $$('li[userid] a[onclick]').filter(function(e) { return e.parentNode.className != 'disabled' });
    var i = 0;
    setInterval(function() { var e = document.createEvent('MouseEvent');
    e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); list[i].dispatchEvent(e); i++ }, 10000);
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2010/10/14 22:20:27 - 2010-10-14
  2. 2010/10/13 18:43:38 - 2010-10-13
  3. 2010/08/27 00:43:18 - 2010-08-27
  4. 2010/08/27 00:42:35 - 2010-08-27
  5. 2010/08/27 00:41:23 - 2010-08-27
  6. 2010/08/27 00:23:48 - 2010-08-27
  7. 2010/08/27 00:21:12 - 2010-08-27
  8. 2010/08/27 00:19:38 - 2010-08-27
  9. 2010/08/27 00:11:53 - 2010-08-27
  10. 2010/08/27 00:10:51 - 2010-08-27
  11. 2010/08/27 00:09:17 - 2010-08-27
  12. 2010/08/27 00:08:48 - 2010-08-27
  13. 2010/08/27 00:07:57 - 2010-08-27
  14. 2010/08/27 00:07:07 - 2010-08-27
  15. 2010/08/27 00:05:59 - 2010-08-27
  16. 2010/08/27 00:00:40 - 2010-08-27
  17. 2010/08/26 23:59:51 - 2010-08-26