瀏覽代碼

Pick worksheet by name

bryan 1 年之前
父節點
當前提交
48644c2694
共有 1 個文件被更改,包括 12 次插入57 次删除
  1. 12 57
      nba_playoffs_game_updater.py

+ 12 - 57
nba_playoffs_game_updater.py

@@ -27,9 +27,9 @@ except ImportError:
 #spreadsheet_key = '1taZ97_PKEGYdSnMAeraPAbFR2U_7-P1GamzIdhlVXjc' # 2023 Test
 spreadsheet_key = '10qAZWyRhwo4Hb4_5X0Q4LFFSudGn2okJNLojwGAg0yI' # 2023 Official
 json_keyfile = 'NBA Playoffs Game-1f9a46f0715c.json'
-day = 'today' # today, else:
-#day = datetime.date(2022, 5, 7) # set date manually
-nba_cooldown = random.gammavariate(alpha=9, beta=0.4) # don't hammer the NBA API
+day = 'today' # today
+#day = datetime.date(2023, 4, 27) # set date manually
+nba_cooldown = random.gammavariate(alpha=9, beta=0.4) # don't hammer the NBA.com API
 stats=['PTS', 'REB', 'AST', 'STL', 'BLK', 'TOV', 'WL'] # stats appear in this order
 
 STATS_HEADERS = {
@@ -46,59 +46,12 @@ STATS_HEADERS = {
     'Cache-Control': 'no-cache',
 }
 
-proxy_url="https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt"
-
-# proxies = [
-#     "206.127.88.18:80",
-#     "47.112.104.235:80",
-#     "60.169.201.13:53315",
-#     "14.207.10.155:8080",
-#     "113.100.209.10:3128",
-#     "113.100.209.145:3128",
-#     "69.162.65.42:5836",
-#     "46.18.210.88:5836",
-#     "203.150.160.95:8080",
-#     "117.252.68.173:8080",
-#     "113.100.209.140:3128",
-#     "218.66.253.146:8800",
-#     "186.159.5.161:8080",
-#     "181.224.161.132:999",
-#     "103.28.90.154:5836",
-#     "113.100.209.116:3128",
-#     "45.231.29.45:8080",
-#     "202.169.255.3:8181",
-#     "103.52.144.242:8080",
-#     "181.78.12.164:999",
-#     "117.67.77.188:4216",
-#     "183.89.63.159:8080",
-#     "88.150.220.130:3128",
-#     "168.195.204.168:8080",
-#     "116.0.2.162:52076",
-#     "58.52.115.99:4216",
-#     "182.23.52.114:6060",
-#     "116.0.3.238:8080",
-#     "175.6.66.48:3128",
-#     "180.183.246.110:8080",
-#     "220.249.149.69:9999",
-#     "103.221.254.102:48146",
-#     "110.77.242.14:8080",
-#     "198.98.59.87:8080",
-#     "209.91.216.168:8080",
-#     "177.8.170.62:8080",
-#     "218.66.253.144:10200",
-#     "113.161.58.255:8080",
-#     "180.244.73.12:8080",
-#     "190.2.210.98:8080",
-#     "82.114.71.98:8080",
-#     "190.103.28.161:999",
-#     "181.119.69.89:3128",
-#     "190.120.249.246:999",
-#     "82.114.115.194:1256",
-#     "218.66.253.146:10084",
-#     "103.146.68.255:8080",
-# ]
-
-proxies = []
+# Proxy URLs
+#proxy_url="https://raw.githubusercontent.com/clarketm/proxy-list/master/proxy-list-raw.txt"
+proxy_url="https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt"
+
+# Manual list of proxies
+# proxies = []
 
 
 ###############################################################################
@@ -126,7 +79,7 @@ def getWorksheet(spreadsheet_key, json_keyfile):
         credentials = ServiceAccountCredentials.from_json_keyfile_name(json_keyfile, scope)
         gc = gspread.authorize(credentials)
         spreadsheet = gc.open_by_key(spreadsheet_key)
-        worksheet = spreadsheet.get_worksheet(0)
+        worksheet = spreadsheet.worksheet("Picks")
     except Exception as e:
         print(f"Exception: {str(e)}")
         print("Could not retrieve worksheet!")
@@ -205,6 +158,8 @@ def cleanFirstNameLastName(player):
         first_name = "T.J."
     elif first_name == "Donavan":
         first_name = "Donovan"
+    elif first_name == "Domantis":
+        first_name = "Domantas"
     last_name = first_name_last_name[1]
     player_clean = first_name + ' ' + last_name
     return player_clean