🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/Rayer/TWLotteryCrawler

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Rayer/TWLotteryCrawler

v1.0.0
Source
Go
Version published
Created
Source

台灣樂透彩爬蟲

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

產生執行檔

  • cd lotteryCli
  • go build -o lotteryCli
  • ./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。

FAQs

Package last updated on 28 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts