加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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

发布时间:2020-12-16 18:16:40 所属栏目:大数据 来源:网络整理
导读:http://live.sports.ifeng.com/match/552.html 看到这个页面需要投票支持下中国队。 直接用Go语言来写下刷票。 package mainimport ("fmt""net/http")func vote(a chan int) {for i := 0; i = 1000; i++ {http.Get("http://survey.news.ifeng.com/accumulato

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

看到这个页面需要投票支持下中国队。

直接用Go语言来写下刷票。

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票。

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

python用urllib,就行代码不放上了。几句代码的事情。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读