Mobile01 Topic Highlight

Mobile01 自動加入文章人氣。

  1. // ==UserScript==
  2. // @author Eucaly61
  3. // @version 0.8
  4. // @name Mobile01 Topic Highlight
  5. // @namespace Eucaly61
  6. // @include http://www.mobile01.com/*
  7. // @description Mobile01 自動加入文章人氣。
  8. // ==/UserScript==
  9.  
  10. // this script was originally based on http://userscripts.org/scripts/review/7671
  11.  
  12. // check latest version at http://userscripts.org/scripts/show/42879
  13.  
  14. /*
  15.  
  16. version history
  17.  
  18. v0.8 on 2012-04-29
  19. * 1st release
  20.  
  21. */
  22. ///// preference section /////
  23.  
  24. var myHighLights = [
  25. {bgcolor: '#e0ffe0', keys: ['家電綜合','居家綜合','空間設計與裝潢','木工DIY']}, /* 淺綠 */
  26. {bgcolor: '#f0f0ff', keys: ['庭院園藝樂','消費經驗分享']}, /* 淺藍 */
  27. {bgcolor: '#fffff0', keys: ['桃園縣','商品買賣']} /* 淺黃 */
  28. ];
  29.  
  30. var showTitle = true;
  31. //var showTitle = false;
  32.  
  33. var titleColor = '#A0A0A0';
  34.  
  35. var debugLevel = 0;
  36.  
  37. ///// code section /////
  38.  
  39. var alltags = document.getElementsByClassName('tablelist forumlist');
  40.  
  41. for(var t=0;t<alltags.length;t++){
  42.  
  43. o=alltags[t];
  44. tr_rows = o.getElementsByTagName('tr');
  45.  
  46. if (debugLevel>0) {
  47. GM_log('rows: ' + tr_rows.length);
  48. }
  49. for (var j=0;j<tr_rows.length;j++) {
  50. tr_this = tr_rows[j];
  51. if (debugLevel>0) {
  52. GM_log('loop: ' + j);
  53. }
  54. td_subject = tr_this.getElementsByClassName('subject')[0];
  55. a_topics = td_subject.getElementsByClassName('topic_gen');
  56.  
  57. for (var p=0;p<a_topics.length;p++) {
  58. a_this = a_topics[p];
  59. if (debugLevel>=2) {
  60. GM_log(a_this.innerHTML);
  61. GM_log(a_this.title);
  62. }
  63. if (showTitle)
  64. td_subject.innerHTML += '<span style="color:' + titleColor + ';"> [ ' + a_this.title + ' ]</span>';
  65. for (var n in myHighLights) {
  66. keys = myHighLights[n].keys;
  67. bgcolor = myHighLights[n].bgcolor;
  68. for (var k in keys) {
  69. if (a_this.title.search(keys[k])>=0) {
  70. if (debugLevel>0) {
  71. GM_log(a_this.innerHTML);
  72. GM_log(a_this.title);
  73. GM_log(bgcolor + ' / ' + keys[k]);
  74. }
  75. tr_this.style.backgroundColor = bgcolor;
  76. break;
  77. if (debugLevel>=3) {
  78. GM_log(tr_this.style);
  79. GM_log(tr_this.innerHTML);
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址