Golang、python多線程刷票,刷的很爽。

http://live.sports.ifeng.com/match/552.htmlphp

看到這個頁面須要投票支持下中國隊。html

直接用Go語言來寫下刷票。python

package main

import (
	
	"fmt"
	"net/http"
)

func vote(a chan int) {
	for i := 0; i <= 1000; i++ {
		http.Get("http://survey.news.ifeng.com/accumulator_ext.php?callback=jQuery1820030119983945041895_1490671752116&key=customLiveaway_support_552&format=js&_=1490671777810")
	}
	a <- 0
}

func main() {
	a := make(chan int, 30)
	for i := 0; i < 30; i++ {
		go vote(a)
	}
	for b := range a {
		fmt.Println(b)
	}
}

上面的代碼能刷3W票。url

 

隨隨便便,我就刷了接近30W票。code

 

python用urllib,就行代碼不放上了。幾句代碼的事情。orm

相關文章
相關標籤/搜索