官网每天上午放10点放10台白色TD
下单不用注册,没有验证码。
秒杀脚本
# encoding: utf-8
require 'net/http'
require 'open-uri'
require 'json'
def order cookies
p "processing..."
http2 = Net::HTTP.new("
store.meizu.com", 80).start
attrs = {
"area" => "320103",
"city" => "3201",
"companyItem" => "你的姓名",
"consAddress" => "收获地址",
"consId" => "",
"consName" => "你的姓名",
"consPhone" => "收件人电话",
"consZipCode" => "邮编",
"province" => "32"
}.map{|k,v| "#{k}=#{v}"}.join("&")
resp =
http2.post("/order/add_submit", attrs, {
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'X-Requested-With' => 'XMLHttpRequest',
'Cookie' => cookies,
"Host" =>'
store.meizu.com',
"User-Agent" => "Mozilla/5.0 (WIN7; rv:18.0) Gecko/20100101 Firefox/18.0"
})
p resp.to_hash["location"]
end
def add_to_cart
sleep 2
p "retry #{Time.now.to_s}"
http = Net::HTTP.new("
store.meizu.com", 80).start
res = http.get("/cart/add_cart?tt=#{rand(900000) + 100000}&product_ext=131&buy_count=1")
p JSON.parse(res.body)
if JSON.parse(res.body)["status"] == 1
@
cookie = res.to_hash['set-cookie'].collect{|ea|ea[/^.*?;/]}.join
else
nil
end
end
while @
cookie == nil do
add_to_cart
end
order(@cookie)