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

相关文章
相关标签/搜索