淘宝抢拍功能

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

Moderator: phoenix

Post Reply
nepter
Posts: 30
Joined: Jan 14 2009, 15:36

淘宝抢拍功能

Post by nepter » Dec 29 2009, 16:50

昨日闲来在淘宝上抢拍手机,可惜淹没在众多抢拍器的绞杀下,便生一念,用P写个规则,增加人工抢拍功能。
效果是在淘宝商品页面上,一口价被替换成一个按钮,点击它将每秒刷新一次购买页面,再点击一次停止。

Code: Select all

Name = "taobao buy"
Active = TRUE
URL = "$TYPE(htm)*item.taobao.com/*"
Limit = 256
Match = "一 口 价$URL(http://item.taobao.com/*-([^-]++)\1.(htm|jhtml))"
Replace = "<script type="text/javascript">"
          "var woIntervalId = 0;"
          "function woClickHandler ( )"
          "{"
          "  if ( document.getElementById("woButton").value == "Click me!" )"
          "  {"
          "     document.getElementById("woButton").value = "Enough!";"
          "    woIntervalId = setInterval ( "wo()", 1000 );"
          "  }"
          "  else"
          "  {"
          "    document.getElementById("woMessage").innerHTML = "";"
          "    document.getElementById("woButton").value = "Click me!";"
          "    clearInterval ( woIntervalId );"
          "  }"
          "}"
          ""
          "function wo ( )"
          "{"
          "  window.open("http://buy.taobao.com/auction/buy_now.jhtml?auction_id=\1","new");"
          "}"
          "</script>"
          ""
          "<div id="woMessage" ></div>"
          "<input type="button" name="clickMe" id="woButton" value="Click me!" onclick="woClickHandler()"/>"
当然这效率和抢拍器是没法比的。纯属练习娱乐之用。

Post Reply