本人是很不喜欢作弊的,但是我不作弊,不代表其他人不作弊,为了公平起见,我们也要作弊,除非官方把作弊渠道给封锁了。这里我教你们用golang(谷歌开发的计算机程序语言)来开发这个小程序,我尽量写的让小白都可以看懂。
第一步,安装go语言开发环境
1.在这里下载go语言安装包,https://golang.google.cn/dl/,对应自己的系统下载。双击安装,安装之后就可以编译解析go语言了,给这里的文科生们多说一句,我们的电脑运行的是01010的二进制代码,安装了这个之后,就可以把我们的写的代码执行,如下的伪代码。
if n > 2 {
dosomething
}
2.下载计算机语言编辑器,https://www.sublimetext.com/,对应自己的系统下载安装。
第二步,编码
下面我直接写好注释给大家,大家可以下载,
package main
//刷阅读量,import是导入一些第三方的代码库
import (
"fmt"
"github.com/satori/go.uuid"
"net/http"
"time"
"strconv"
"math/rand"
"bufio"
"bytes"
// "io/ioutil"
"os"
"github.com/urfave/cli"
)
//这个是简书的网页地址
var urlS = "https://www.jianshu.com/p/"
func GetUID() string {
id := uuid.NewV4()
uid := id.String()
return uid
// return strings.Replace(uid, "-", "", -1)
}
var (
app *cli.App
configPath string
)
//这个是我们的刷阅读量的主要程序代码
func GetURL(id, se []byte) {
second, err := strconv.Atoi(string(se))
if err != nil {
fmt.Println("参数错误")
} else {
for i := 0; i < second; i++ {
var jsonStr = []byte("")
req, err := http.NewRequest("GET", urlS+string(id), bytes.NewBuffer(jsonStr))
req.Header.Set("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3")
req.Header.Set("accept-encoding", "gzip, deflate, br")
req.Header.Set("cache-control", "max-age=0")
req.Header.Set("cookie", "if_shakespeare=1; sajssdk_2015_cross_new_user=1; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2216d8ce3c19a32-020def57eb3a8b-1d3d6b55-1296000-16d8ce3c19b484%22%2C%22%24device_id%22%3A%2216d8ce3c19a32-020def57eb3a8b-1d3d6b55-1296000-16d8ce3c19b484%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%7D; Hm_lvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1570026800; __yadk_uid=uWSzDAQMYbu8bBnFhwbLRJ2DlBqNpOQ4; locale=zh-CN; Hm_lpvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1570026810")
req.Header.Set("if-none-match", "155d5-MblZWRdrcEosECyhXQuwjqwKi40")
req.Header.Set("sec-fetch-mode", "navigate")
req.Header.Set("sec-fetch-site", "same-origin")
req.Header.Set("sec-fetch-user", "?1")
req.Header.Set("upgrade-insecure-requests", "1")
req.Header.Set("user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("response Status:", resp.Status)
fmt.Println("response Headers:", resp.Header)
Urls2 := "https://www.jianshu.com/shakespeare/notes/"+string(id)+"/mark_viewed"
//模仿
data23 := `{"fuck":1}`
var jsonStr23 = []byte(data23)
req2, err := http.NewRequest("POST", Urls2, bytes.NewBuffer(jsonStr23))
req2.Header.Set("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3")
req2.Header.Set("accept-encoding", "gzip, deflate, br")
req2.Header.Set("cache-control", "max-age=0")
req2.Header.Set("cookie", "if_shakespeare=1; sajssdk_2015_cross_new_user=1; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2216d8ce3c19a32-020def57eb3a8b-1d3d6b55-1296000-16d8ce3c19b484%22%2C%22%24device_id%22%3A%2216d8ce3c19a32-020def57eb3a8b-1d3d6b55-1296000-16d8ce3c19b484%22%2C%22props%22%3A%7B%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%7D; Hm_lvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1570026800; __yadk_uid=uWSzDAQMYbu8bBnFhwbLRJ2DlBqNpOQ4; locale=zh-CN; Hm_lpvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1570026810")
req2.Header.Set("if-none-match", "155d5-MblZWRdrcEosECyhXQuwjqwKi40")
req2.Header.Set("sec-fetch-mode", "navigate")
req2.Header.Set("sec-fetch-site", "same-origin")
req2.Header.Set("sec-fetch-user", "?1")
req2.Header.Set("upgrade-insecure-requests", "1")
req2.Header.Set("user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36")
client2 := &http.Client{}
resp2, err := client2.Do(req2)
if err != nil {
panic(err)
}
defer resp2.Body.Close()
fmt.Println("response Status:", resp2.Status)
fmt.Println("response Headers:", resp2.Header)
}
}
}
func init() {
app = cli.NewApp()
app.Name = "刷阅读量"
app.Usage = "刷刷刷"
app.Author = "baojiao"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "c",
Value: "",
Destination: &configPath,
Usage: "./yaml/conf.yaml",
},
}
}
//这个是我们的代码入口,所有执行最开始的地方
func main() {
reader := bufio.NewReader(os.Stdin)
fmt.Print("请输入文章id:")//这个id文章开头可以有教你怎么获取。
data, _, _ := reader.ReadLine()
reader3 := bufio.NewReader(os.Stdin)
fmt.Print("请输入每次刷新次数:")
data3, _, _ := reader3.ReadLine()
fmt.Printf("正在准备启动,执行文章id为%s,每任意1-10秒刷%s次.\r\n", data, data3)
time.Sleep(time.Second * 3)
//随机数种子
rand.Seed(time.Now().UnixNano())
for i := 0; i < 3000000; i++ {
x := rand.Intn(10)
//1-10秒随机执行时间
time.Sleep(time.Second * time.Duration(x))
GetURL(data, data3)
}
// return nil
}
第三,运行程序
go run main.go
最后执行的成果,这里面还有一些小bug,明天我起来改。
有疑问加站长微信联系(非本文作者)