Skip to content

Commit

Permalink
Update ff_bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcarls authored Sep 20, 2017
1 parent 8f6d5ce commit a82b10b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ff_bot/ff_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def get_close_scores(league):
return '\n'.join(text)

def get_power_rankings(league):
'''Gets current week's Matchups'''
'''Gets current week's power rankings'''
'''Using 2 step dominance, as well as a combination of points scored and margin of victory.
It's weighted 80/15/5 respectively'''
pranks = league.power_rankings(week=3)
pranks = league.power_rankings(week=4)

score = ['%s - %s' % (i[0], i[1].team_name) for i in pranks
if i]
Expand Down

5 comments on commit a82b10b

@OldAchilles
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the app on Heroku update everytime you push a change to master? The app posted the init message in the groupme on its own.

@dtcarls
Copy link
Owner Author

@dtcarls dtcarls commented on a82b10b Sep 20, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OldAchilles
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you manually changing the week, every week? Can we write code that would automatically determine the week given the date? Something like:

import datetime
import math
season_start = datetime.datetime(2017,9,6)
current_time = datetime.datetime.now()
date_diff = current_time-season_start
week = int(math.ceil(date_diff/7.0))

@dtcarls
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a pull request in the ESPN FF API repo that will default to the latest week (see here #1) but this may be a good stop gap so I (and others that have deployed) don't need to manually update it each week.

@raulvasquez
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to have the week calculated or just fork their API. I think I have backstroke.us to keep your code in sync my fork of ff_bot. I then have that fork linked with Heroku so it should auto-deploy.

It looks like the cawdev/ff_bot fork is making a lot of progress with some features and functionality.

Please sign in to comment.