由于某些原因, 重装了firefox, 下了webmail notier, 结果QQ邮箱死活不能收取和登录, 于是看了一下, 发现新版的QQ邮箱把登录from的id给改了, 于是修改了一下原来的脚本, 测试mail.qq.com可用. foxmail和vip.qq.com没有测试.

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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**********************************************************
QQ
**********************************************************/
var name="QQ";
var ver="2011-11-03";
 
function init(){
  this.name="QQ";
  this.initStage=ST_PRE;
  this.dataURL="http://mail.qq.com/";
  this.loginData=["https://mail.qq.com/cgi-bin/login"];
  this.mailURL="http://mail.qq.com/";
}
 
function getCount(aData){
   var fnd=aData.match(/\u90ae\u4ef6\uff1a<b>.*?(\d+).*?<\/b>/);
   if(fnd){
     return fnd[1];
   }else{
     return -1;
   }
}
 
function process(aHttpChannel, aData) {
  switch(this.stage){
  case ST_PRE:
    this.getHtml("https://mail.qq.com/cgi-bin/loginpage");
    return false;
  case ST_PRE_RES:
    var ar=this.user.split("@");
    this.stage=ST_LOGIN;
    this.getHtml(this.loginData[LOGIN_URL],
                    "&pwd="+encodeURIComponent(this.password)
                      +"&uin="+encodeURIComponent(ar[0])
                      +"&aliastype=%40"+encodeURIComponent(ar[1]))+"&btlogin=+%E7%99%BB%E5%BD%95+";
    return false;
  case ST_LOGIN_RES:
    var fnd=aData.match(/urlHead="(\S+?)"/);
    if(fnd){
      var url=fnd[1];
      fnd=aData.match(/urlHead\s*?\+\s*?"(\S+?)"/);
      if(fnd){
        url+=fnd[1];
        this.dataURL=url.replace("frame_html","today");
        fnd=aData.match(/targetUrl\+="(\S+?)"/);
        if(fnd){
          this.mailURL=url+fnd[1];
          break;
        }
      }
    }
    return true;
  }
  return this.baseProcess(aHttpChannel, aData);
};

6 条评论

  1. nnnn At 2011-11-09 01:47 Said: 回复

    [smile] 感谢楼主,困扰我好久的问题终于解决了!!

  2. 额。。。光棍节没啥事,过来看看。。

    过节了吗?

  3. 我都是直接开网页看邮箱,QQ邮箱web界面还是比较喜欢的。

  4. 对于技术文章我一直坚持撸过原则

  5. 做技术就是好啊 自己动手 丰衣足食~~ [wink]

  6. 看不懂呃。。。

[wink] [twisted] [smile] [she] [se] [sad] [razz] [nosay] [mad] [lol] [jiong] [idea] [han] [eek]

[使用Ctrl+回车快速提交]