全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: sdomusic
打印 上一主题 下一主题

[Windows VPS] 求个火狐下能用的自动换签名的脚本!

[复制链接]
11#
 楼主| 发表于 2012-7-10 20:18:49 | 只看该作者
Captain 发表于 2012-7-10 20:14
问A大,貌似没提供把

另外问下cp大**  
景安512找你拿几折啊
12#
发表于 2012-7-10 20:23:43 | 只看该作者
FF下没测试
13#
 楼主| 发表于 2012-7-10 20:27:43 | 只看该作者
wusir 发表于 2012-7-10 20:23
FF下没测试


求修改适配火狐!
14#
发表于 2012-7-10 20:35:16 | 只看该作者
高级插件越来越多了 ........
15#
发表于 2012-7-11 10:50:08 | 只看该作者
FF下测试通过
  1. // ==UserScript==
  2. // @name           Automatic update signature
  3. // @description    自动更新签名
  4. // @author         wusir
  5. //loc.193.gs/*
  6. // @version        2.2
  7. // ==/UserScript==

  8. (function(){
  9.         var href = window.location.href;
  10.         
  11.         function matchNode(xpath, context)
  12.         {
  13.                 return document.evaluate(context?(xpath.indexOf('.')==0?xpath:'.' + xpath):xpath, context || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  14.         }
  15.                
  16.                 //*
  17.         if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1))
  18.         {
  19.                 this.GM_getValue = function (key,def) {
  20.                         return localStorage[key] || def;
  21.                 };
  22.                 this.GM_setValue = function (key,value) {
  23.                         return localStorage[key]=value;
  24.                 };
  25.                 this.GM_deleteValue = function (key) {
  26.                         return delete localStorage[key];
  27.                 };
  28.         }
  29.                 //*/
  30.         
  31.         var updateTime = GM_getValue('updateTime',new Date().getTime());//最后更新时间
  32.         var intervalTime = 1*60*1000;//更新间隔时间
  33.         var nowTime = new Date().getTime();//现在时间
  34.         var sIndex = GM_getValue('sIndex', 0);

  35.         //loc.193.gs/memcp.php?action=profile&typeid=4";
  36.         var memcp = "http://loc.193.gs/home.php?mod=spacecp&ac=profile&op=info";
  37.         var formhash = '';
  38.                 var idcard = '';
  39.                 var address = '';
  40.                 var zipcode= '';
  41.                 var site = '';
  42.                 var bio = '';
  43.                 var interest = '';
  44.                 var customstatus = '';
  45.                 var sightml = '';
  46.                 var timeoffset = '';

  47.         var signature = new Array();//签名设置数组
  48.         signature[0] = '[color=red][size=5]10分钟邮箱:BccTo.Me[/size][/color]';
  49.         signature[1] = '广告位出租';
  50.         signature[2] = '自动签名1';
  51.         signature[3] = '自动签名2';
  52.         signature[4] = '自动签名3';
  53.         GM_log('updateTime:' + updateTime);
  54.         GM_log('nowTime:' + nowTime);
  55.         if(nowTime - updateTime >= intervalTime)
  56.         {
  57.                 GM_log('nowTime - updateTime = ' + (nowTime - updateTime));
  58.                 updateSignature();
  59.         }
  60.         else
  61.         {
  62.                 var time = intervalTime - (nowTime - updateTime);
  63.                 GM_log('Time=' + time);
  64.                 if(time < 0)
  65.                         time = 0;
  66.                 setTimeout(updateSignature, time);
  67.         }
  68.                 //updateSignature();//for test
  69.         function updateSignature()
  70.         {
  71.                 GM_log('update start');
  72.                 GM_xmlhttpRequest({
  73.                         method: 'GET',
  74.                         url: memcp,
  75.                         overrideMimeType: 'text/xml; charset=utf-8',
  76.                         onreadystatechange: function(resp){
  77.                                 if(resp.readyState == 4)
  78.                                 {
  79.                                         if (resp.status == 200)
  80.                                         {
  81.                                                 var text = resp.responseText;
  82.                                                                                                 //GM_log(text);
  83.                                                 var tm = '';
  84.                                                 if(tm = text.match(/<input type="hidden" value="(.+?)" name="formhash" \/>/))
  85.                                                         formhash = tm[1];
  86.                                                                                                 if(tm = text.match(/<input type="text" name="idcard" class="px" value="(.+?)" tabindex="1" \/>/))
  87.                                                                                                                 idcard = tm[1];
  88.                                                                                                 if(tm = text.match(/<input type="text" name="address" class="px" value="(.+?)" tabindex="1" \/>/))
  89.                                                                                                                 address = tm[1];
  90.                                                                                                 if(tm = text.match(/<input type="text" name="zipcode" class="px" value="(.+?)" tabindex="1" \/>/))
  91.                                                                                                                 zipcode = tm[1];
  92.                                                                                                 if(tm = text.match(/<input type="text" name="site" class="px" value="(.+?)" tabindex="1" \/>/))
  93.                                                                                                                 site = tm[1];
  94.                                                 if(tm = text.match(/<textarea name="bio" id="bio".+?>(.+?)<\/textarea>/))
  95.                                                         bio = tm[1];
  96.                                                                                                 if(tm = text.match(/<textarea name="interest" id="interest" class="pt" rows="3" cols="40" tabindex="1">(.+?)<\/textarea>/))
  97.                                                                                                                 interest = tm[1];
  98.                                                                                                 if(tm = text.match(/<input type="text" value="(.+?)" name="customstatus" id="customstatus" class="px" \/>/))
  99.                                                                                                                 customstatus = tm[1];
  100.                                                                                                 if(tm = text.match(/<textarea rows="3" cols="80" name="sightml" id="sightmlmessage" class="pt".+?>(.+?)<\/textarea>/))
  101.                                                                                                                 sightml = tm[1];
  102.                                                 /*
  103.                                                 var signnew = signature[0];
  104.                                                 for(var i = 0; i < signature.length; i++)
  105.                                                 {
  106.                                                         var sign = signature[i];
  107.                                                         if(sign == sightml)
  108.                                                         {
  109.                                                                 if(i + 1 >= signature.length)
  110.                                                                         signnew = signature[0];
  111.                                                                 else
  112.                                                                         signnew = signature[i + 1];
  113.                                                                 break;
  114.                                                         }
  115.                                                 }
  116.                                                 */
  117.                                                 var signnew = signature[sIndex];
  118.                                                 if(parseInt(sIndex) + 1 >= signature.length)
  119.                                                 {
  120.                                                     sIndex = 0;
  121.                                                     GM_setValue('sIndex', 0);
  122.                                                 }
  123.                                                 else
  124.                                                 {
  125.                                                     sIndex++;
  126.                                                     GM_setValue('sIndex', sIndex);
  127.                                                 }
  128.                                                 var datastr = "formhash=" + formhash + "&idcardtype=身份证&privacy[idcardtype]=0&idcard=" + idcard + "&privacy[idcard]=0&address=" + address + "&privacy[address]=0&zipcode=" + zipcode + "&privacy[zipcode]=0&site=" + site + "&privacy[site]=0&bio=" + bio + "&privacy[bio]=0&interest=" + interest + "&privacy[interest]=0&customstatus=" + customstatus + "&sightml=" + signnew + "&timeoffset=9999&profilesubmit=true&profilesubmitbtn=true";
  129.                                                 GM_log('str:' + datastr);
  130.                                                 GM_xmlhttpRequest({
  131.                                                         method: "POST",
  132.                                                         url: memcp,
  133.                                                         data: datastr,
  134.                                                         headers: {'Content-type': 'application/x-www-form-urlencoded'},
  135.                                                         onload: function(resp) {
  136.                                                                 var text = resp.responseText;
  137.                                                                 GM_log('update successfully');
  138.                                                                                                                                 //GM_log(text);
  139.                                                                 if(text.indexOf('parent.show_success(\'\')') > -1)
  140.                                                                         GM_setValue('updateTime',new Date().getTime());
  141.                                                                 setTimeout(updateSignature, intervalTime);
  142.                                                         }
  143.                                                 });
  144.                                         }
  145.                                 }
  146.                         },
  147.                         onerror: function(){
  148.                                 return;
  149.                         }
  150.                 });
  151.         }
  152. })();
复制代码
16#
发表于 2012-7-11 11:06:08 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
17#
 楼主| 发表于 2012-7-11 15:03:07 | 只看该作者
wusir 发表于 2012-7-11 10:50
FF下测试通过


还是原来的代码啊。
我用上了怎么不变化啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-4-12 10:38 , Processed in 0.061294 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表