diff --git a/README.md b/README.md index e12a1f2..0795513 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,12 @@ Previously there were records dating back to 1992 that were removed by the websi I am welcoming anyone who wants to to port it to their own state/country to do so. I currently have a website www.wvlotterypredictor.xyz hosting my numbers to be refreshed daily. Collaboration and suggestion to a more accurate algorithm is also welcome. I can be contacted about the project through my site email, on here, or on the Twitter linked on my site. # Good luck! + +# CHANGELOG +- June 29th 2022: Added support for old data that was previously scrubbed from the lottery site. It is more accurate and more accurate than the previous one. Chance for daily3 is now bugged however due to the large amount of numbers and dates. This will be fixed soon. + +# TODO: +- Correct chance numbers for Daily3 + + + diff --git a/cash25.py b/cash25.py index bdd319d..07cfb05 100755 --- a/cash25.py +++ b/cash25.py @@ -5,6 +5,10 @@ import requests from collections import Counter def get_data(): + # old data from WVLottery.com + df_old = pd.read_excel('./excel_lotto_records/cash25.xlsx') + salvaged = df_old[['Date', 'Numbers']] + url = 'https://wvlottery.com/draw-games/cash-25/?game-analyze=cash-25&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -16,7 +20,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/daily3.py b/daily3.py index d80903e..6f483d8 100755 --- a/daily3.py +++ b/daily3.py @@ -5,7 +5,7 @@ import requests from collections import Counter def get_data(): - url = 'https://wvlottery.com/draw-games/daily-3/?game-analyze=daily-3&what-to-search=historysearch&date-range=1' + url = 'https://wvlottery.com/draw-games/daily-3/?game-analyze=daily-3&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", "X-Requested-With": "XMLHttpRequest" @@ -37,7 +37,7 @@ for n in range(0, 10): sorted_nums = sorted(likely_nums) total_freq = sum(frequency) -Chance = frac(total_freq, 1000) # Chance = number call freq / all possible numbers i.e. 1000 +Chance = frac(total_freq, 15000) # Chance = number call freq / all possible numbers i.e. 1000 Winning_Numbers = str("-".join(sorted_nums)) print(f"Likely numbers are . . . {Winning_Numbers} \n" diff --git a/daily4.py b/daily4.py index 3ab1a7f..89e22a4 100755 --- a/daily4.py +++ b/daily4.py @@ -5,6 +5,10 @@ import requests from collections import Counter def get_data(): + # Old data from WVLottery.com + df_old = pd.read_excel('./excel_lotto_records/daily4.xlsx') + salvaged = df_old[['Date', 'Numbers']] + url = 'https://wvlottery.com/draw-games/daily-4/?game-analyze=daily-4&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -15,7 +19,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/excel_lotto_records.tar.gz b/excel_lotto_records.tar.gz new file mode 100644 index 0000000..de5e28c Binary files /dev/null and b/excel_lotto_records.tar.gz differ diff --git a/excel_lotto_records/cash25.xlsx b/excel_lotto_records/cash25.xlsx new file mode 100644 index 0000000..630547b Binary files /dev/null and b/excel_lotto_records/cash25.xlsx differ diff --git a/excel_lotto_records/daily3.xlsx b/excel_lotto_records/daily3.xlsx new file mode 100644 index 0000000..4eeba68 Binary files /dev/null and b/excel_lotto_records/daily3.xlsx differ diff --git a/excel_lotto_records/daily4.xlsx b/excel_lotto_records/daily4.xlsx new file mode 100644 index 0000000..dbf7351 Binary files /dev/null and b/excel_lotto_records/daily4.xlsx differ diff --git a/excel_lotto_records/lotto.xlsx b/excel_lotto_records/lotto.xlsx new file mode 100644 index 0000000..3b9a588 Binary files /dev/null and b/excel_lotto_records/lotto.xlsx differ diff --git a/excel_lotto_records/lotto_america.xlsx b/excel_lotto_records/lotto_america.xlsx new file mode 100644 index 0000000..4e5279a Binary files /dev/null and b/excel_lotto_records/lotto_america.xlsx differ diff --git a/excel_lotto_records/lotto_megamil.xlsx b/excel_lotto_records/lotto_megamil.xlsx new file mode 100644 index 0000000..31e5961 Binary files /dev/null and b/excel_lotto_records/lotto_megamil.xlsx differ diff --git a/lotto_america.py b/lotto_america.py index 4a3c497..e6f5bf4 100755 --- a/lotto_america.py +++ b/lotto_america.py @@ -5,6 +5,9 @@ import requests from collections import Counter def get_data(): + df_old = pd.read_excel('./excel_lotto_records/lotto_america.xlsx') + salvaged = df_old[['Date', 'Numbers', 'SB', 'All Star']] + url = 'https://wvlottery.com/draw-games/lotto-america/?game-analyze=lotto-america&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -16,7 +19,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers', 'SB', 'All Star']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/lottopy_pb.py b/lottopy_pb.py index 9439237..2ed8c3d 100755 --- a/lottopy_pb.py +++ b/lottopy_pb.py @@ -5,6 +5,11 @@ import requests from collections import Counter def get_data(): + # previous records which have since been removed from wvlottery.com's database + df_old = pd.read_excel('./excel_lotto_records/lotto.xlsx') + salvaged = df_old[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']] + + # Current web records url = 'https://wvlottery.com/draw-games/powerball/?game-analyze=powerball&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -15,7 +20,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers', 'PB', 'PPX', 'Winners WV Only', 'Payout WV Only']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/megamil.py b/megamil.py index 80b63bd..20cd59c 100755 --- a/megamil.py +++ b/megamil.py @@ -5,6 +5,10 @@ import requests from collections import Counter def get_data(): + # previous records which have since been removed from wvlottery.com's database + df_old = pd.read_excel('./excel_lotto_records/lotto_megamil.xlsx') + salvaged = df_old[['Date', 'Numbers', 'MB']] + url = 'https://wvlottery.com/draw-games/mega-millions/?game-analyze=mega-millions&what-to-search=historysearch&date-range=-1' header = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", @@ -16,7 +20,7 @@ def get_data(): dfs = pd.read_html(r.text) pd.set_option('display.max_rows', None) # Specifies no max rows, otherwise only shows 10 records - df = dfs[0] + df = dfs[0].append(salvaged, ignore_index=True) df2 = df[['Date', 'Numbers', 'MB', 'MP']] date = list(df2['Date']) nums = list(df2['Numbers'].astype('str')) diff --git a/start.sh b/start.sh index 21a7460..f0731f3 100755 --- a/start.sh +++ b/start.sh @@ -4,15 +4,15 @@ # MIT License # Edit to your need -echo "Powerball" && +echo "<--------> Powerball <-------->" && python lottopy_pb.py && -echo "MegaMillions" && +echo "<--------> MegaMillions <-------->" && python megamil.py && -echo "Lotto America" && +echo "<--------> Lotto America <-------->" && python lotto_america.py && -echo "Daily3" && +echo "<--------> Daily3 <-------->" && python daily3.py && -echo "Daily4" && +echo "<--------> Daily4 <-------->" && python daily4.py && -echo "Cash25" && +echo "<--------> Cash25 <-------->" && python cash25.py