Skip to content

Commit

Permalink
Merge pull request #171 from cwendt94/RecentActivityFAAB
Browse files Browse the repository at this point in the history
Recent activity faab
  • Loading branch information
cwendt94 authored Jan 5, 2021
2 parents 49bf5fb + 4482bdb commit 705725d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions espn_api/football/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def __init__(self, data, player_map, get_team_data, player_info):
team = ''
action = 'UNKNOWN'
player = None
bid_amount = 0
msg_id = msg['messageTypeId']
if msg_id == 244:
team = get_team_data(msg['from'])
Expand All @@ -17,17 +18,19 @@ def __init__(self, data, player_map, get_team_data, player_info):
team = get_team_data(msg['to'])
if msg_id in ACTIVITY_MAP:
action = ACTIVITY_MAP[msg_id]
if action == 'WAIVER ADDED':
bid_amount = msg.get('from', 0)
if team:
for team_player in team.roster:
if team_player.playerId == msg['targetId']:
player = team_player
break
if not player:
player = player_info(playerId=msg['targetId'])
self.actions.append((team, action, player))
self.actions.append((team, action, player, bid_amount))

def __repr__(self):
return 'Activity(' + ' '.join("(%s,%s,%s)" % tup for tup in self.actions) + ')'
return 'Activity(' + ' '.join("(%s,%s,%s)" % tup[0:3] for tup in self.actions) + ')'



Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name='espn_api',
packages=find_packages(),
version='0.9.4',
version='0.10.0',
author='Christian Wendt',
description='ESPN API',
install_requires=['requests>=2.0.0,<3.0.0'],
Expand Down

0 comments on commit 705725d

Please sign in to comment.