taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

针对特定网站的规则分享、讨论

Moderator: phoenix

User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by phoenix »

淘宝默认为opera和firefox启动的是网页版旺旺,本规则将增加一个形如 wangwang:SendIM?userid 的链接以启动旺旺客户端。

Code: Select all

[Patterns]
Name = "Add WangWang IM Link for Opera/Firefox 2009.03.03 [phoenix]"
Active = TRUE
URL = "$TYPE(htm)item.taobao.com/auction/item_detail$OHDR(User-Agent:*(opera|firefox)*)"
Bounds = "<span\s[^>]+></span>"
Limit = 128
Match = "(<span class\="ww:token' ww:params\=\"nick=\1\&*)\0$STOP()"
Replace = " <a href="wangwang:SendIM?\1"><span style="color:red; font-weight:bold;">@@</span></a> \r\n\0"
有兴趣的同学可以研究下旺旺客户端对话框中的焦点商品是以什么样的参数传递过去的。 :D
wangwang.png
wangwang.png (16.4 KiB) Viewed 24257 times
Ray4
Moderator
Posts: 65
Joined: Dec 30 2007, 09:37

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by Ray4 »

http://item.taobao.com/auction/item_det ... html?pm1=2

比如这种卖家信息在左边的,很多都不正常,log里显示成功,firefox里查看源代码东西也在,只是用firebug查看没有,不知道是否是其它脚本的问题
User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by phoenix »

以你举的例子来说,掌柜档案那个方块的右侧有个切换条,可以把掌柜档案的信息切换到右侧显示,我们增加的链接就出来了。所以,应该是有脚本在控制那块区域的显示。
ddbb
Moderator
Posts: 425
Joined: Jan 07 2008, 13:30

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by ddbb »

左边和右边的是不同的代码.....

因为有$STOP() 所以只匹配了第1个....第2个没匹配....

PH能说说为什么要加这个STOP么
User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by phoenix »

我以为只有1个 :( ,那么把$STOP()去掉就行了...
User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by phoenix »

更新了下:
1、不再局限于淘宝商品描述页面,现在作用于所有淘宝页面,目前我只测试了搜索商品页面,已买到的宝贝页面
2、增加了传递商品焦点到旺旺的功能

Code: Select all

[Patterns]
Name = "Add WangWang IM Link for Opera/Firefox 2009.04.04 [phoenix]"
Active = TRUE
URL = "$TYPE(htm)[^/]++.taobao.com/$OHDR(User-Agent:*(opera|firefox)*)"
Bounds = "<span\s[^>]+></span>"
Limit = 192
Match = "("
        "(<span class\="ww:token' ww:params\=\"nick=\1\&*&(*\&item=\2\&*|$URL(*item_detail-(0|)db1-\2.jhtml*)))"
        "|<span class\="J_WangWang' data-nick\="\1\"*data-item\=\"\2:*"
        ")\0"
Replace = " <a href="wangwang:SendIM?uid=\1&gid=\2"><span style="color:red; font-weight:bold;">@@</span></a> \r\n\0"
ddbb
Moderator
Posts: 425
Joined: Jan 07 2008, 13:30

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by ddbb »

http://item.taobao.com/auction/item_det ... html?pm1=2

就是上面的那个地址.......最新的规则........不出来了.......
User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by phoenix »

那个地址是 item_detail-0db2-bdf9b0192cd935b9f59cdd72fd424a4f.jhtml ,我原来匹配的是 db1 。

更新了下:

Code: Select all

[Patterns]
Name = "Add WangWang IM Link for Opera/Firefox 2009.04.13 [phoenix]"
Active = TRUE
URL = "$TYPE(htm)[^/]++.taobao.com/$OHDR(User-Agent:*(opera|firefox)*)"
Bounds = "<span\s[^>]+></span>"
Limit = 192
Match = "("
        "(<span class\="ww:token' ww:params\=\"nick=\1\&*&(*\&item=\2\&*|$URL(*item_detail-(0|)db[12]-\2.*|*item_id=([0-9a-z]+)\2*)))"
        "|<span class\="J_WangWang' data-nick\="\1\"*data-item\=\"\2:*"
        ")\0"
Replace = " <a href="wangwang:SendIM?uid=\1&gid=\2"><span style="color:red; font-weight:bold;">@@</span></a> \r\n\0"
Last edited by phoenix on Apr 13 2009, 17:22, edited 1 time in total.
Reason: 修改URL匹配代码以适应更多URL格式
User avatar
phoenix
Site Admin
Posts: 525
Joined: Dec 29 2007, 16:27

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by phoenix »

旺旺2009使用了新的协议格式: aliim:sendmsg?touid=cntaobaosellerID&gid=itemID

Code: Select all

[Patterns]
Name = "Add WangWang IM Link for Opera/Firefox 2010.01.18 [phoenix]"
Active = TRUE
URL = "$TYPE(htm)[^/]++.taobao.com/$OHDR(User-Agent:*(opera|firefox)*)"
Bounds = "<span\s[^>]+></span>"
Limit = 192
Match = "("
        "(<span class\="ww:token' ww:params\=\"nick=\1\&*&(*\&item=\2\&*|$URL(*item_detail-(0|)db[12]-\2.*|*item_id=([0-9a-z]+)\2*)))"
        "|<span class\="J_WangWang' data-nick\="\1\"*data-item\=\"\2:*"
        ")\0"
Replace = " <a href="aliim:sendmsg?touid=cntaobao\1&gid=\2"><span style="color:red; font-weight:bold;">@@</span></a> \r\n\0"
red
Posts: 99
Joined: Mar 09 2010, 16:25

Re: taobao.com 淘宝商品页面为Opera/Firefox增加旺旺链接

Post by red »

规则已经失效,阿里旺旺现在的协议格式只要aliim:sendmsg?touid=cntaobaosellerID就行,gid之类的可以不加了
自己试着写了下,被编码所困扰,一会gbk,一会utf8。卖家用户名是中文时就不正确
还有带<span class\="ww:token' ww:params的页面现在还有没

Code: Select all

[Patterns]
Name = "Add WangWang IM Link for Opera/Firefox 2010.09.21 [phoenix]"
Active = TRUE
URL = "$TYPE(htm)[^/]++.taobao.com/$OHDR(User-Agent:*(opera|firefox)*)"
Bounds = "<span\s[^>]+></span>"
Limit = 192
Match = "("
        "(<span class\="ww:token' ww:params\=\"nick=\1\&*&(*\&item=\2\&*|$URL(*item_detail-(0|)db[12]-\2.*|*item_id=([0-9a-z]+)\2*)))"
        "|<span class\="J_WangWang' data-nick\="\1\"*"
        ")\0"
Replace = " <a href="aliim:sendmsg?touid=cntaobao\1"><span style="color:red; font-weight:bold;">@@</span></a> \r\n\0"
test page http://item.taobao.com/auction/item_det ... 4233944101
Post Reply