Skip to content

Commit

Permalink
grabbing drafts by sleeper username
Browse files Browse the repository at this point in the history
  • Loading branch information
brownjf2027 committed Jul 21, 2024
1 parent 2074a79 commit 76effc5
Show file tree
Hide file tree
Showing 13 changed files with 4,694 additions and 7,615 deletions.
8,696 changes: 4,348 additions & 4,348 deletions csv_upload.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions data.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def get_leagues(year, user_id):


def get_drafts(year, user_id):
drafts_url = DRAFTS_BY_USER.replace("<user_id>", user_id)
user_data = get_user(user_id)
user = user_data["user_id"]
drafts_url = DRAFTS_BY_USER.replace("<user_id>", user)
drafts_url = drafts_url.replace("<season>", str(year))
parameters = {}
response = requests.get(drafts_url, params=parameters)
Expand Down Expand Up @@ -150,7 +152,9 @@ def update_player_data_for_site():

# try:
# user_data = get_user("jfbrown")
# drafts = get_drafts("2024", user_data["user_id"])
# yr = datetime.now().year
# drafts = get_drafts(yr, user_data["user_id"])
# print(drafts)
#
# except requests.RequestException:
# print("not found")
17 changes: 9 additions & 8 deletions draft.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "snake",
"status": "complete",
"start_time": 1710279973013,
"status": "paused",
"start_time": 1721176188266,
"sport": "nfl",
"slot_to_roster_id": {
"9": 9,
Expand Down Expand Up @@ -35,18 +35,19 @@
"scoring_type": "std",
"name": "",
"is_autopaused": "false",
"elapsed_pick_timer": "4545",
"description": ""
},
"league_id": null,
"last_picked": 1710279974177,
"last_message_time": 1710279974187,
"last_message_id": "1073395646641479680",
"last_picked": 1721541313450,
"last_message_time": 1721541318002,
"last_message_id": "1120629146050203648",
"draft_order": {
"738962794141077504": 4
"738962794141077504": 5
},
"draft_id": "1073181409734414336",
"draft_id": "1119097568354553856",
"creators": [
"738962794141077504"
],
"created": 1710228896128
"created": 1721176161418
}
Loading

0 comments on commit 76effc5

Please sign in to comment.