GithubHelp home page GithubHelp logo

twlotterycrawler's Introduction

台灣樂透彩爬蟲

目前有大樂透以及威力彩,以及一個簡易的cli。

產生執行檔

  1. cd lotteryCli
  2. go build -o lotteryCli
  3. ./lotteryCli

產生範例:

➜  lotteryCli git:(master) ✗ ./lotteryCli
[0] 威力彩
[1] 大樂透
請選擇服務 [0] : 0
Fetching data from server...
一共取得10期資料:
[0]	110000068期	(2021-8-26)
[1]	110000067期	(2021-8-23)
[2]	110000066期	(2021-8-19)
[3]	110000065期	(2021-8-16)
[4]	110000064期	(2021-8-12)
[5]	110000063期	(2021-8-9)
[6]	110000062期	(2021-8-5)
[7]	110000061期	(2021-8-2)
[8]	110000060期	(2021-7-29)
[9]	110000059期	(2021-7-26)
請選擇期數[0] :
0
Data fetched!
本期威力彩第110000068期:
開獎日期:2021/8/26
A區:		[25 31 18 22 35 27]
排序後A區:	[18 22 25 27 31 35]
B區:1

請輸入號碼,以空白隔開。前六個數字為A區,最後一個數字為B區,共七組:
18 22 25 27 31 35 1
中獎了!(第1區6個+第2區) 獎金:20025854, 獎項: 頭獎
請輸入號碼,以空白隔開。前六個數字為A區,最後一個數字為B區,共七組:

當作library使用

安裝

go get github.com/Rayer/TWLotteryCrawler

使用

使用很簡單,直接使用以下兩個函式即可,不用什麼參數:

  • 大樂透 : ParseL649FromHistoryPage()
  • 威力彩 : ParseSL638FromHistoryPage()

會回來一組 []result,裡面為最近十組開獎的結果,而 result.RewardOf() 則可以用來對獎,將獎號輸入即可產生Reward結構,內有獎項說明以及獎金。

限制

目前來講台彩並沒有提供API,所以這邊的結果其實是上他們家網頁去爬下來分析的。這樣做的結果就是,當他們網頁改版,這個鐵定就會壞掉。

但是呢,他們至少三年以上都沒改過版!所以應該可以安心的使用一陣子.... 也期待他們能夠哪天腦袋轉過來開放API。

twlotterycrawler's People

Contributors

rayer avatar

Stargazers

Allan Bian avatar  avatar  avatar Corey avatar Tony Yang avatar Evan Lin avatar Shoi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.