用戶
 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

掃一掃,登錄網站

小程序社區 首頁 教程 查看內容

汉诺威96对勒沃库森视频:手把手教大家寫一個刷簡書閱讀量的小程序

汉诺威96升级 www.wikuss.com.cn Rolan 2019-10-8 00:14

本人是很不喜歡作弊的,但是我不作弊,不代表其他人不作弊,為了公平起見,我們也要作弊,除非官方把作弊渠道給封鎖了。這里我教你們用golang(谷歌開發的計算機程序語言)來開發這個小程序,我盡量寫的讓小白都可以看 ...

本人是很不喜歡作弊的,但是我不作弊,不代表其他人不作弊,為了公平起見,我們也要作弊,除非官方把作弊渠道給封鎖了。這里我教你們用golang(谷歌開發的計算機程序語言)來開發這個汉诺威96升级,我盡量寫的讓小白都可以看懂。

第一步,安裝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,明天我起來改。

分享至 : QQ空間
收藏
原作者: studygolang 來自: studygolang