Skip to content
Browse files

Site updated at 2012-06-18 11:44:10 UTC

  • Loading branch information...
1 parent 657ad15 commit 9787c3daab306864daf2ccd8b4eca7b07f55bbec @wongyouth committed Jun 18, 2012
View
165 atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-26T11:03:54+08:00</updated>
+ <updated>2012-06-18T19:40:55+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
@@ -14,6 +14,169 @@
<entry>
+ <title type="html"><![CDATA[tmall砸金蛋活动脚本]]></title>
+ <link href="http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan/"/>
+ <updated>2012-06-18T19:32:00+08:00</updated>
+ <id>http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan</id>
+ <content type="html"><![CDATA[<p>今天淘宝在砸猫猫,砸金蛋对抗京东店庆日。砸金蛋让人砸到手酸啊。
+于是就写个脚本砸,虽然机会太微妙,不过看着自动砸挺开心哈。</p>
+
+<p>运行环境 ruby</p>
+
+<pre><code>gem install capybara # install capybara
+ruby zha.rb # zha.rb在下方
+</code></pre>
+
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+<span class='line-number'>7</span>
+<span class='line-number'>8</span>
+<span class='line-number'>9</span>
+<span class='line-number'>10</span>
+<span class='line-number'>11</span>
+<span class='line-number'>12</span>
+<span class='line-number'>13</span>
+<span class='line-number'>14</span>
+<span class='line-number'>15</span>
+<span class='line-number'>16</span>
+<span class='line-number'>17</span>
+<span class='line-number'>18</span>
+<span class='line-number'>19</span>
+<span class='line-number'>20</span>
+<span class='line-number'>21</span>
+<span class='line-number'>22</span>
+<span class='line-number'>23</span>
+<span class='line-number'>24</span>
+<span class='line-number'>25</span>
+<span class='line-number'>26</span>
+<span class='line-number'>27</span>
+<span class='line-number'>28</span>
+<span class='line-number'>29</span>
+<span class='line-number'>30</span>
+<span class='line-number'>31</span>
+<span class='line-number'>32</span>
+<span class='line-number'>33</span>
+<span class='line-number'>34</span>
+<span class='line-number'>35</span>
+<span class='line-number'>36</span>
+<span class='line-number'>37</span>
+<span class='line-number'>38</span>
+<span class='line-number'>39</span>
+<span class='line-number'>40</span>
+<span class='line-number'>41</span>
+<span class='line-number'>42</span>
+<span class='line-number'>43</span>
+<span class='line-number'>44</span>
+<span class='line-number'>45</span>
+<span class='line-number'>46</span>
+<span class='line-number'>47</span>
+<span class='line-number'>48</span>
+<span class='line-number'>49</span>
+<span class='line-number'>50</span>
+<span class='line-number'>51</span>
+<span class='line-number'>52</span>
+<span class='line-number'>53</span>
+<span class='line-number'>54</span>
+<span class='line-number'>55</span>
+<span class='line-number'>56</span>
+<span class='line-number'>57</span>
+<span class='line-number'>58</span>
+<span class='line-number'>59</span>
+<span class='line-number'>60</span>
+<span class='line-number'>61</span>
+<span class='line-number'>62</span>
+<span class='line-number'>63</span>
+<span class='line-number'>64</span>
+<span class='line-number'>65</span>
+<span class='line-number'>66</span>
+<span class='line-number'>67</span>
+<span class='line-number'>68</span>
+<span class='line-number'>69</span>
+<span class='line-number'>70</span>
+<span class='line-number'>71</span>
+</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># encoding: utf-8</span>
+</span><span class='line'><span class="c1">#</span>
+</span><span class='line'><span class="c1"># 淘宝砸金蛋脚本</span>
+</span><span class='line'><span class="c1"># 当前目录建立 tmall 文件放入帐号:密码,分号隔开</span>
+</span><span class='line'><span class="c1">#</span>
+</span><span class='line'><span class="c1"># email to wongyouth@gmail.com</span>
+</span><span class='line'><span class="c1"># github blog http://wongyouth.github.com</span>
+</span><span class='line'>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;rubygems&#39;</span>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;capybara&#39;</span>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;capybara/dsl&#39;</span>
+</span><span class='line'><span class="kp">include</span> <span class="no">Capybara</span><span class="o">::</span><span class="no">DSL</span>
+</span><span class='line'>
+</span><span class='line'><span class="no">Capybara</span><span class="o">.</span><span class="n">default_driver</span> <span class="o">=</span> <span class="ss">:selenium</span>
+</span><span class='line'><span class="no">Capybara</span><span class="o">.</span><span class="n">app_host</span> <span class="o">=</span> <span class="s1">&#39;http://www.tmall.com&#39;</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">login</span>
+</span><span class='line'> <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="o">=</span> <span class="n">get_userinfo</span>
+</span><span class='line'>
+</span><span class='line'> <span class="n">visit</span><span class="p">(</span><span class="s1">&#39;http://login.tmall.com&#39;</span><span class="p">)</span>
+</span><span class='line'>
+</span><span class='line'> <span class="n">setup_frame</span><span class="p">(</span><span class="s1">&#39;loginframe&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="n">within_frame</span><span class="p">(</span><span class="s1">&#39;loginframe&#39;</span><span class="p">)</span> <span class="k">do</span>
+</span><span class='line'> <span class="n">fill_in</span> <span class="s1">&#39;TPL_username&#39;</span><span class="p">,</span> <span class="ss">:with</span> <span class="o">=&gt;</span> <span class="n">username</span>
+</span><span class='line'> <span class="n">fill_in</span> <span class="s1">&#39;TPL_password&#39;</span><span class="p">,</span> <span class="ss">:with</span> <span class="o">=&gt;</span> <span class="n">password</span>
+</span><span class='line'> <span class="n">click_button</span> <span class="s1">&#39;登录&#39;</span>
+</span><span class='line'> <span class="k">end</span>
+</span><span class='line'><span class="k">rescue</span> <span class="o">=&gt;</span> <span class="n">e</span>
+</span><span class='line'> <span class="nb">puts</span> <span class="n">e</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">get_userinfo</span>
+</span><span class='line'> <span class="n">info</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="no">File</span><span class="o">.</span><span class="n">expand_path</span><span class="p">(</span><span class="s1">&#39;../tmall&#39;</span><span class="p">,</span> <span class="bp">__FILE__</span><span class="p">),</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="p">{</span><span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span> <span class="p">}</span>
+</span><span class='line'> <span class="n">info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">setup_frame</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
+</span><span class='line'> <span class="n">setup_jquery</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> jQuery(&#39;iframe&#39;).attr(&#39;name&#39;, &#39;</span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="sx">&#39;);</span>
+</span><span class='line'><span class="sx"> jQuery(&#39;iframe&#39;).attr(&#39;id&#39;, &#39;</span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="sx">&#39;);</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">setup_jquery</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> var jq = document.createElement(&#39;script&#39;);</span>
+</span><span class='line'><span class="sx"> jq.src = &quot;http://code.jquery.com/jquery-latest.min.js&quot;;</span>
+</span><span class='line'><span class="sx"> document.getElementsByTagName(&#39;head&#39;)[0].appendChild(jq);</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'> <span class="nb">sleep</span> <span class="mi">3</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> jQuery.noConflict();</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">zha</span>
+</span><span class='line'> <span class="n">visit</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="mi">10000</span><span class="o">.</span><span class="n">downto</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span>
+</span><span class='line'> <span class="n">btn</span> <span class="o">=</span> <span class="n">find</span><span class="p">(</span><span class="s1">&#39;#J_Vol_Brick_Btn&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="n">btn</span><span class="o">.</span><span class="n">click</span>
+</span><span class='line'> <span class="nb">sleep</span> <span class="mi">0</span><span class="o">.</span><span class="mi">5</span>
+</span><span class='line'> <span class="k">end</span>
+</span><span class='line'><span class="k">rescue</span> <span class="o">=&gt;</span> <span class="n">e</span>
+</span><span class='line'> <span class="nb">puts</span> <span class="n">e</span>
+</span><span class='line'> <span class="k">retry</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="n">login</span>
+</span><span class='line'><span class="n">zha</span>
+</span></code></pre></td></tr></table></div></figure>
+
+
+
+]]></content>
+ </entry>
+
+ <entry>
<title type="html"><![CDATA[Git分支常用操作]]></title>
<link href="http://wongyouth.github.com/blog/2012/04/26/git-branch/"/>
<updated>2012-04-26T10:55:00+08:00</updated>
View
4 blog/2012/04/21/install-octopress-to-write-blogs-and-deploy-on-github-dot-com/index.html
@@ -261,6 +261,10 @@ <h1 class="entry-title">用octopress来写博客并发布到Github上</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
4 blog/2012/04/21/install-ruby-environment-on-ubuntu/index.html
@@ -250,6 +250,10 @@ <h1 class="entry-title">Ubuntu下安装ruby开发环境</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
6 blog/2012/04/26/git-branch/index.html
@@ -189,6 +189,8 @@ <h1 class="entry-title">Git分支常用操作</h1>
<a class="basic-alignment left" href="/blog/2012/04/26/git-tagging/" title="Previous Post: Git标签常用操作">&laquo; Git标签常用操作</a>
+ <a class="basic-alignment right" href="/blog/2012/06/18/tmall-za-jin-dan/" title="Next Post: tmall砸金蛋活动脚本">tmall砸金蛋活动脚本 &raquo;</a>
+
</p>
</footer>
</article>
@@ -208,6 +210,10 @@ <h1 class="entry-title">Git分支常用操作</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
4 blog/2012/04/26/git-tagging/index.html
@@ -255,6 +255,10 @@ <h1 class="entry-title">Git标签常用操作</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
426 blog/2012/06/18/tmall-za-jin-dan/index.html
@@ -0,0 +1,426 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>tmall砸金蛋活动脚本 - Wongyouth's Blog</title>
+ <meta name="author" content="Wongyouth">
+
+
+ <meta name="description" content="今天淘宝在砸猫猫,砸金蛋对抗京东店庆日。砸金蛋让人砸到手酸啊。
+于是就写个脚本砸,虽然机会太微妙,不过看着自动砸挺开心哈。 运行环境 ruby gem install capybara # install capybara
+ruby zha.rb # zha.rb在下方 1
+2
+3
+4
+5
+6
+7 &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="Wongyouth's Blog" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">Wongyouth's Blog</a></h1>
+
+ <h2>Do things the stupid way.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:wongyouth.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Tmall砸金蛋活动脚本</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-06-18T19:32:00+08:00" pubdate data-updated="true">2012-06-18</time>
+
+ | <a href="#disqus_thread">Comments</a>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>今天淘宝在砸猫猫,砸金蛋对抗京东店庆日。砸金蛋让人砸到手酸啊。
+于是就写个脚本砸,虽然机会太微妙,不过看着自动砸挺开心哈。</p>
+
+<p>运行环境 ruby</p>
+
+<pre><code>gem install capybara # install capybara
+ruby zha.rb # zha.rb在下方
+</code></pre>
+
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+<span class='line-number'>7</span>
+<span class='line-number'>8</span>
+<span class='line-number'>9</span>
+<span class='line-number'>10</span>
+<span class='line-number'>11</span>
+<span class='line-number'>12</span>
+<span class='line-number'>13</span>
+<span class='line-number'>14</span>
+<span class='line-number'>15</span>
+<span class='line-number'>16</span>
+<span class='line-number'>17</span>
+<span class='line-number'>18</span>
+<span class='line-number'>19</span>
+<span class='line-number'>20</span>
+<span class='line-number'>21</span>
+<span class='line-number'>22</span>
+<span class='line-number'>23</span>
+<span class='line-number'>24</span>
+<span class='line-number'>25</span>
+<span class='line-number'>26</span>
+<span class='line-number'>27</span>
+<span class='line-number'>28</span>
+<span class='line-number'>29</span>
+<span class='line-number'>30</span>
+<span class='line-number'>31</span>
+<span class='line-number'>32</span>
+<span class='line-number'>33</span>
+<span class='line-number'>34</span>
+<span class='line-number'>35</span>
+<span class='line-number'>36</span>
+<span class='line-number'>37</span>
+<span class='line-number'>38</span>
+<span class='line-number'>39</span>
+<span class='line-number'>40</span>
+<span class='line-number'>41</span>
+<span class='line-number'>42</span>
+<span class='line-number'>43</span>
+<span class='line-number'>44</span>
+<span class='line-number'>45</span>
+<span class='line-number'>46</span>
+<span class='line-number'>47</span>
+<span class='line-number'>48</span>
+<span class='line-number'>49</span>
+<span class='line-number'>50</span>
+<span class='line-number'>51</span>
+<span class='line-number'>52</span>
+<span class='line-number'>53</span>
+<span class='line-number'>54</span>
+<span class='line-number'>55</span>
+<span class='line-number'>56</span>
+<span class='line-number'>57</span>
+<span class='line-number'>58</span>
+<span class='line-number'>59</span>
+<span class='line-number'>60</span>
+<span class='line-number'>61</span>
+<span class='line-number'>62</span>
+<span class='line-number'>63</span>
+<span class='line-number'>64</span>
+<span class='line-number'>65</span>
+<span class='line-number'>66</span>
+<span class='line-number'>67</span>
+<span class='line-number'>68</span>
+<span class='line-number'>69</span>
+<span class='line-number'>70</span>
+<span class='line-number'>71</span>
+</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># encoding: utf-8</span>
+</span><span class='line'><span class="c1">#</span>
+</span><span class='line'><span class="c1"># 淘宝砸金蛋脚本</span>
+</span><span class='line'><span class="c1"># 当前目录建立 tmall 文件放入帐号:密码,分号隔开</span>
+</span><span class='line'><span class="c1">#</span>
+</span><span class='line'><span class="c1"># email to wongyouth@gmail.com</span>
+</span><span class='line'><span class="c1"># github blog http://wongyouth.github.com</span>
+</span><span class='line'>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;rubygems&#39;</span>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;capybara&#39;</span>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;capybara/dsl&#39;</span>
+</span><span class='line'><span class="kp">include</span> <span class="no">Capybara</span><span class="o">::</span><span class="no">DSL</span>
+</span><span class='line'>
+</span><span class='line'><span class="no">Capybara</span><span class="o">.</span><span class="n">default_driver</span> <span class="o">=</span> <span class="ss">:selenium</span>
+</span><span class='line'><span class="no">Capybara</span><span class="o">.</span><span class="n">app_host</span> <span class="o">=</span> <span class="s1">&#39;http://www.tmall.com&#39;</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">login</span>
+</span><span class='line'> <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="o">=</span> <span class="n">get_userinfo</span>
+</span><span class='line'>
+</span><span class='line'> <span class="n">visit</span><span class="p">(</span><span class="s1">&#39;http://login.tmall.com&#39;</span><span class="p">)</span>
+</span><span class='line'>
+</span><span class='line'> <span class="n">setup_frame</span><span class="p">(</span><span class="s1">&#39;loginframe&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="n">within_frame</span><span class="p">(</span><span class="s1">&#39;loginframe&#39;</span><span class="p">)</span> <span class="k">do</span>
+</span><span class='line'> <span class="n">fill_in</span> <span class="s1">&#39;TPL_username&#39;</span><span class="p">,</span> <span class="ss">:with</span> <span class="o">=&gt;</span> <span class="n">username</span>
+</span><span class='line'> <span class="n">fill_in</span> <span class="s1">&#39;TPL_password&#39;</span><span class="p">,</span> <span class="ss">:with</span> <span class="o">=&gt;</span> <span class="n">password</span>
+</span><span class='line'> <span class="n">click_button</span> <span class="s1">&#39;登录&#39;</span>
+</span><span class='line'> <span class="k">end</span>
+</span><span class='line'><span class="k">rescue</span> <span class="o">=&gt;</span> <span class="n">e</span>
+</span><span class='line'> <span class="nb">puts</span> <span class="n">e</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">get_userinfo</span>
+</span><span class='line'> <span class="n">info</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="no">File</span><span class="o">.</span><span class="n">expand_path</span><span class="p">(</span><span class="s1">&#39;../tmall&#39;</span><span class="p">,</span> <span class="bp">__FILE__</span><span class="p">),</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="p">{</span><span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span> <span class="p">}</span>
+</span><span class='line'> <span class="n">info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">setup_frame</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
+</span><span class='line'> <span class="n">setup_jquery</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> jQuery(&#39;iframe&#39;).attr(&#39;name&#39;, &#39;</span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="sx">&#39;);</span>
+</span><span class='line'><span class="sx"> jQuery(&#39;iframe&#39;).attr(&#39;id&#39;, &#39;</span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="sx">&#39;);</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">setup_jquery</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> var jq = document.createElement(&#39;script&#39;);</span>
+</span><span class='line'><span class="sx"> jq.src = &quot;http://code.jquery.com/jquery-latest.min.js&quot;;</span>
+</span><span class='line'><span class="sx"> document.getElementsByTagName(&#39;head&#39;)[0].appendChild(jq);</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'> <span class="nb">sleep</span> <span class="mi">3</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> jQuery.noConflict();</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">zha</span>
+</span><span class='line'> <span class="n">visit</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="mi">10000</span><span class="o">.</span><span class="n">downto</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span>
+</span><span class='line'> <span class="n">btn</span> <span class="o">=</span> <span class="n">find</span><span class="p">(</span><span class="s1">&#39;#J_Vol_Brick_Btn&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="n">btn</span><span class="o">.</span><span class="n">click</span>
+</span><span class='line'> <span class="nb">sleep</span> <span class="mi">0</span><span class="o">.</span><span class="mi">5</span>
+</span><span class='line'> <span class="k">end</span>
+</span><span class='line'><span class="k">rescue</span> <span class="o">=&gt;</span> <span class="n">e</span>
+</span><span class='line'> <span class="nb">puts</span> <span class="n">e</span>
+</span><span class='line'> <span class="k">retry</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="n">login</span>
+</span><span class='line'><span class="n">zha</span>
+</span></code></pre></td></tr></table></div></figure>
+
+
+
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">Wongyouth</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-06-18T19:32:00+08:00" pubdate data-updated="true">2012-06-18</time>
+
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan/" data-via="" data-counturl="http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+ <a class="basic-alignment left" href="/blog/2012/04/26/git-branch/" title="Previous Post: Git分支常用操作">&laquo; Git分支常用操作</a>
+
+
+ </p>
+ </footer>
+</article>
+
+ <section>
+ <h1>Comments</h1>
+ <div id="disqus_thread" aria-live="polite"><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+</div>
+ </section>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/04/26/git-tagging/">Git标签常用操作</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/04/21/install-octopress-to-write-blogs-and-deploy-on-github-dot-com/">用octopress来写博客并发布到Github上</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/04/21/install-ruby-environment-on-ubuntu/">Ubuntu下安装ruby开发环境</a>
+ </li>
+
+ </ul>
+</section>
+
+<section>
+ <h1>GitHub Repos</h1>
+ <ul id="gh_repos">
+ <li class="loading">Status updating...</li>
+ </ul>
+
+ <a href="https://github.com/wongyouth">@wongyouth</a> on GitHub
+
+ <script type="text/javascript">
+ $.domReady(function(){
+ if (!window.jXHR){
+ var jxhr = document.createElement('script');
+ jxhr.type = 'text/javascript';
+ jxhr.src = '/javascripts/libs/jXHR.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(jxhr, s);
+ }
+
+ github.showRepos({
+ user: 'wongyouth',
+ count: 0,
+ skip_forks: true,
+ target: '#gh_repos'
+ });
+ });
+ </script>
+ <script src="/javascripts/github.js" type="text/javascript"> </script>
+</section>
+
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - Wongyouth -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+<script type="text/javascript">
+ var disqus_shortname = 'wongyouth';
+
+
+ // var disqus_developer = 1;
+ var disqus_identifier = 'http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan/';
+ var disqus_url = 'http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan/';
+ var disqus_script = 'embed.js';
+
+ (function () {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ }());
+</script>
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
View
19 blog/archives/index.html
@@ -9,10 +9,11 @@
<meta name="author" content="Wongyouth">
- <meta name="description" content="Blog Archive 2012 Git分支常用操作
+ <meta name="description" content="Blog Archive 2012 tmall砸金蛋活动脚本
+Jun 18 2012 Git分支常用操作
Apr 26 2012 posted in git Git标签常用操作
Apr 26 2012 posted in git 用octopress来写博客并发布到Github上
-Apr 21 2012 posted in blog, &hellip;">
+Apr 21 &hellip;">
<!-- http://t.co/dKP3o1e -->
@@ -82,6 +83,16 @@ <h1 class="entry-title">Blog Archive</h1>
<article>
+<h1><a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a></h1>
+<time datetime="2012-06-18T19:32:00+08:00" pubdate><span class='month'>Jun</span> <span class='day'>18</span> <span class='year'>2012</span></time>
+
+
+</article>
+
+
+
+<article>
+
<h1><a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a></h1>
<time datetime="2012-04-26T10:55:00+08:00" pubdate><span class='month'>Apr</span> <span class='day'>26</span> <span class='year'>2012</span></time>
@@ -148,6 +159,10 @@ <h1 class="entry-title">Blog Archive</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
2 blog/categories/blog/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: blog | Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/blog/categories/blog/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-26T11:03:54+08:00</updated>
+ <updated>2012-06-18T19:40:55+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
View
4 blog/categories/blog/index.html
@@ -103,6 +103,10 @@ <h1 class="entry-title">Category: Blog</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
2 blog/categories/git/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: git | Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/blog/categories/git/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-26T11:03:54+08:00</updated>
+ <updated>2012-06-18T19:40:55+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
View
4 blog/categories/git/index.html
@@ -117,6 +117,10 @@ <h1 class="entry-title">Category: Git</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
2 blog/categories/github/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: github | Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/blog/categories/github/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-26T11:03:54+08:00</updated>
+ <updated>2012-06-18T19:40:55+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
View
4 blog/categories/github/index.html
@@ -103,6 +103,10 @@ <h1 class="entry-title">Category: Github</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
2 blog/categories/ruby/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: ruby | Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/blog/categories/ruby/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-26T11:03:54+08:00</updated>
+ <updated>2012-06-18T19:40:55+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
View
4 blog/categories/ruby/index.html
@@ -103,6 +103,10 @@ <h1 class="entry-title">Category: Ruby</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
2 blog/categories/ubuntu/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: ubuntu | Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/blog/categories/ubuntu/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-04-26T11:03:54+08:00</updated>
+ <updated>2012-06-18T19:40:55+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
View
4 blog/categories/ubuntu/index.html
@@ -103,6 +103,10 @@ <h1 class="entry-title">Category: Ubuntu</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
206 index.html
@@ -9,7 +9,15 @@
<meta name="author" content="Wongyouth">
- <meta name="description" content="生存一个分支,名字为issue1 git branch issue1 切换到一个分支issue1 git checkout issue1 生存一个本地分支并切换到它 git checkout -b issue1 修改后提交 git commit -am 'fix issue1' 切换到主分支 &hellip;">
+ <meta name="description" content="今天淘宝在砸猫猫,砸金蛋对抗京东店庆日。砸金蛋让人砸到手酸啊。
+于是就写个脚本砸,虽然机会太微妙,不过看着自动砸挺开心哈。 运行环境 ruby gem install capybara # install capybara
+ruby zha.rb # zha.rb在下方 1
+2
+3
+4
+5
+6
+7 &hellip;">
<!-- http://t.co/dKP3o1e -->
@@ -70,6 +78,198 @@
<header>
+ <h1 class="entry-title"><a href="/blog/2012/06/18/tmall-za-jin-dan/">Tmall砸金蛋活动脚本</a></h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-06-18T19:32:00+08:00" pubdate data-updated="true">2012-06-18</time>
+
+ | <a href="/blog/2012/06/18/tmall-za-jin-dan/#disqus_thread">Comments</a>
+
+ </p>
+
+ </header>
+
+
+ <div class="entry-content"><p>今天淘宝在砸猫猫,砸金蛋对抗京东店庆日。砸金蛋让人砸到手酸啊。
+于是就写个脚本砸,虽然机会太微妙,不过看着自动砸挺开心哈。</p>
+
+<p>运行环境 ruby</p>
+
+<pre><code>gem install capybara # install capybara
+ruby zha.rb # zha.rb在下方
+</code></pre>
+
+<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+<span class='line-number'>7</span>
+<span class='line-number'>8</span>
+<span class='line-number'>9</span>
+<span class='line-number'>10</span>
+<span class='line-number'>11</span>
+<span class='line-number'>12</span>
+<span class='line-number'>13</span>
+<span class='line-number'>14</span>
+<span class='line-number'>15</span>
+<span class='line-number'>16</span>
+<span class='line-number'>17</span>
+<span class='line-number'>18</span>
+<span class='line-number'>19</span>
+<span class='line-number'>20</span>
+<span class='line-number'>21</span>
+<span class='line-number'>22</span>
+<span class='line-number'>23</span>
+<span class='line-number'>24</span>
+<span class='line-number'>25</span>
+<span class='line-number'>26</span>
+<span class='line-number'>27</span>
+<span class='line-number'>28</span>
+<span class='line-number'>29</span>
+<span class='line-number'>30</span>
+<span class='line-number'>31</span>
+<span class='line-number'>32</span>
+<span class='line-number'>33</span>
+<span class='line-number'>34</span>
+<span class='line-number'>35</span>
+<span class='line-number'>36</span>
+<span class='line-number'>37</span>
+<span class='line-number'>38</span>
+<span class='line-number'>39</span>
+<span class='line-number'>40</span>
+<span class='line-number'>41</span>
+<span class='line-number'>42</span>
+<span class='line-number'>43</span>
+<span class='line-number'>44</span>
+<span class='line-number'>45</span>
+<span class='line-number'>46</span>
+<span class='line-number'>47</span>
+<span class='line-number'>48</span>
+<span class='line-number'>49</span>
+<span class='line-number'>50</span>
+<span class='line-number'>51</span>
+<span class='line-number'>52</span>
+<span class='line-number'>53</span>
+<span class='line-number'>54</span>
+<span class='line-number'>55</span>
+<span class='line-number'>56</span>
+<span class='line-number'>57</span>
+<span class='line-number'>58</span>
+<span class='line-number'>59</span>
+<span class='line-number'>60</span>
+<span class='line-number'>61</span>
+<span class='line-number'>62</span>
+<span class='line-number'>63</span>
+<span class='line-number'>64</span>
+<span class='line-number'>65</span>
+<span class='line-number'>66</span>
+<span class='line-number'>67</span>
+<span class='line-number'>68</span>
+<span class='line-number'>69</span>
+<span class='line-number'>70</span>
+<span class='line-number'>71</span>
+</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># encoding: utf-8</span>
+</span><span class='line'><span class="c1">#</span>
+</span><span class='line'><span class="c1"># 淘宝砸金蛋脚本</span>
+</span><span class='line'><span class="c1"># 当前目录建立 tmall 文件放入帐号:密码,分号隔开</span>
+</span><span class='line'><span class="c1">#</span>
+</span><span class='line'><span class="c1"># email to wongyouth@gmail.com</span>
+</span><span class='line'><span class="c1"># github blog http://wongyouth.github.com</span>
+</span><span class='line'>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;rubygems&#39;</span>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;capybara&#39;</span>
+</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;capybara/dsl&#39;</span>
+</span><span class='line'><span class="kp">include</span> <span class="no">Capybara</span><span class="o">::</span><span class="no">DSL</span>
+</span><span class='line'>
+</span><span class='line'><span class="no">Capybara</span><span class="o">.</span><span class="n">default_driver</span> <span class="o">=</span> <span class="ss">:selenium</span>
+</span><span class='line'><span class="no">Capybara</span><span class="o">.</span><span class="n">app_host</span> <span class="o">=</span> <span class="s1">&#39;http://www.tmall.com&#39;</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">login</span>
+</span><span class='line'> <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="o">=</span> <span class="n">get_userinfo</span>
+</span><span class='line'>
+</span><span class='line'> <span class="n">visit</span><span class="p">(</span><span class="s1">&#39;http://login.tmall.com&#39;</span><span class="p">)</span>
+</span><span class='line'>
+</span><span class='line'> <span class="n">setup_frame</span><span class="p">(</span><span class="s1">&#39;loginframe&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="n">within_frame</span><span class="p">(</span><span class="s1">&#39;loginframe&#39;</span><span class="p">)</span> <span class="k">do</span>
+</span><span class='line'> <span class="n">fill_in</span> <span class="s1">&#39;TPL_username&#39;</span><span class="p">,</span> <span class="ss">:with</span> <span class="o">=&gt;</span> <span class="n">username</span>
+</span><span class='line'> <span class="n">fill_in</span> <span class="s1">&#39;TPL_password&#39;</span><span class="p">,</span> <span class="ss">:with</span> <span class="o">=&gt;</span> <span class="n">password</span>
+</span><span class='line'> <span class="n">click_button</span> <span class="s1">&#39;登录&#39;</span>
+</span><span class='line'> <span class="k">end</span>
+</span><span class='line'><span class="k">rescue</span> <span class="o">=&gt;</span> <span class="n">e</span>
+</span><span class='line'> <span class="nb">puts</span> <span class="n">e</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">get_userinfo</span>
+</span><span class='line'> <span class="n">info</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="no">File</span><span class="o">.</span><span class="n">expand_path</span><span class="p">(</span><span class="s1">&#39;../tmall&#39;</span><span class="p">,</span> <span class="bp">__FILE__</span><span class="p">),</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="p">{</span><span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span> <span class="p">}</span>
+</span><span class='line'> <span class="n">info</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;:&#39;</span><span class="p">)</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">setup_frame</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
+</span><span class='line'> <span class="n">setup_jquery</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> jQuery(&#39;iframe&#39;).attr(&#39;name&#39;, &#39;</span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="sx">&#39;);</span>
+</span><span class='line'><span class="sx"> jQuery(&#39;iframe&#39;).attr(&#39;id&#39;, &#39;</span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="sx">&#39;);</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">setup_jquery</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> var jq = document.createElement(&#39;script&#39;);</span>
+</span><span class='line'><span class="sx"> jq.src = &quot;http://code.jquery.com/jquery-latest.min.js&quot;;</span>
+</span><span class='line'><span class="sx"> document.getElementsByTagName(&#39;head&#39;)[0].appendChild(jq);</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'> <span class="nb">sleep</span> <span class="mi">3</span>
+</span><span class='line'> <span class="n">page</span><span class="o">.</span><span class="n">execute_script</span> <span class="sx">%Q{</span>
+</span><span class='line'><span class="sx"> jQuery.noConflict();</span>
+</span><span class='line'><span class="sx"> }</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="k">def</span> <span class="nf">zha</span>
+</span><span class='line'> <span class="n">visit</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="mi">10000</span><span class="o">.</span><span class="n">downto</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span>
+</span><span class='line'> <span class="n">btn</span> <span class="o">=</span> <span class="n">find</span><span class="p">(</span><span class="s1">&#39;#J_Vol_Brick_Btn&#39;</span><span class="p">)</span>
+</span><span class='line'> <span class="n">btn</span><span class="o">.</span><span class="n">click</span>
+</span><span class='line'> <span class="nb">sleep</span> <span class="mi">0</span><span class="o">.</span><span class="mi">5</span>
+</span><span class='line'> <span class="k">end</span>
+</span><span class='line'><span class="k">rescue</span> <span class="o">=&gt;</span> <span class="n">e</span>
+</span><span class='line'> <span class="nb">puts</span> <span class="n">e</span>
+</span><span class='line'> <span class="k">retry</span>
+</span><span class='line'><span class="k">end</span>
+</span><span class='line'>
+</span><span class='line'><span class="n">login</span>
+</span><span class='line'><span class="n">zha</span>
+</span></code></pre></td></tr></table></div></figure>
+
+
+
+</div>
+
+
+
+
+ </article>
+
+
+ <article>
+
+ <header>
+
<h1 class="entry-title"><a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a></h1>
@@ -544,6 +744,10 @@ <h1 class="entry-title"><a href="/blog/2012/04/21/install-ruby-environment-on-ub
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/06/18/tmall-za-jin-dan/">tmall砸金蛋活动脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/04/26/git-branch/">Git分支常用操作</a>
</li>
View
8 sitemap.xml
@@ -19,11 +19,15 @@
<lastmod>2012-04-26T11:02:59+08:00</lastmod>
</url>
<url>
+ <loc>http://wongyouth.github.com/blog/2012/06/18/tmall-za-jin-dan/</loc>
+ <lastmod>2012-06-18T19:40:02+08:00</lastmod>
+ </url>
+ <url>
<loc>http://wongyouth.github.com/blog/archives/</loc>
- <lastmod>2012-04-26T11:02:59+08:00</lastmod>
+ <lastmod>2012-06-18T19:40:02+08:00</lastmod>
</url>
<url>
<loc>http://wongyouth.github.com/</loc>
- <lastmod>2012-04-26T11:02:59+08:00</lastmod>
+ <lastmod>2012-06-18T19:40:02+08:00</lastmod>
</url>
</urlset>

0 comments on commit 9787c3d

Please sign in to comment.
Something went wrong with that request. Please try again.