Skip to content

Commit

Permalink
re-add power rankings, more README formatting, upgrade ff_espn_api
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcarls committed Aug 9, 2019
1 parent cf05c1f commit dc3709f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,29 +234,27 @@ You're done! You now have a fully featured GroupMe/Slack/Discord chat bot for ES
Unfortunately to do auto deploys of the latest version you need admin access to the repository on git. You can check for updates on the github page (https://github.com/dtcarls/ff_bot/commits/master) and click the deploy button again; however, this will deploy a new instance and the variables will need to be edited again.

#### Private Leagues
For private league you will need to get your swid and espn_s2.
You can find these two values after logging into your espn fantasy football account on espn's website.
(Chrome Browser)
Right click anywhere on the website and click inspect option.
For private league you will need to get your swid and espn_s2.
You can find these two values after logging into your espn fantasy football account on espn's website.
(Chrome Browser)
Right click anywhere on the website and click inspect option.
From there click Application on the top bar.
On the left under Storage section click Cookies then http://fantasy.espn.com.
From there you should be able to find your swid and espn_s2 variables and values!
On the left under Storage section click Cookies then http://fantasy.espn.com.
From there you should be able to find your swid and espn_s2 variables and values.

## Troubleshooting / FAQ

**League must be full.**

The bot isn't working
Did you miss a step in the instructions? Try doing it from scratch again. If still no luck, post here so the answer can be shared with others.

How are power ranks calculated?
**This feature is currently disabled**
They are calculated using 2 step dominance, as well as a combination of points scored and margin of victory. Weighted 80/15/5 respectively. I wouldn't so much pay attention to the actual number but more of the gap between teams.
Full source of the calculations can be seen here: https://github.com/rbarton65/espnff/blob/master/espnff/utils.py
They are calculated using 2 step dominance, as well as a combination of points scored and margin of victory. Weighted 80/15/5 respectively. I wouldn't so much pay attention to the actual number but more of the gap between teams. Full source of the calculations can be seen here: https://github.com/cwendt94/ff-espn-api/commit/61f8a34de5c42196ba0b1552aa25282297f070c5

Is there a version of this for Yahoo/CBS/NFL/[insert other site]?
No, this would require a significant rework for other sites.

The bot isn't working
Did you miss a step in the instructions? Try doing it from scratch again. If still no luck, post here so the answer can be shared with others.

I'm not getting the init message
Are you sure you flipped the switch in Heroku to activate the worker (the toggle should be blue)? The other common mistake is misconfigured environment variables.

Expand All @@ -269,7 +267,7 @@ Specify your variable https://en.wikipedia.org/wiki/List_of_tz_database_time_zon
Is there a version of this for Messanger/WhatsApp/[insert other chat]?
No, but I am open to pull requests implementing their API for cross platform support.

Like the bot? Consider making a donation to buy me a coffee
Like the bot? Star the repository and consider making a donation to buy me a coffee
------
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZDLFECJVGG6RG&currency_code=USD&source=url)
* BTC: 3C8SEcDh52iDSYQY55kwELrNWoQRMkXLCR
Expand Down
12 changes: 6 additions & 6 deletions ff_bot/ff_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def bot_main(function):
print(get_scoreboard(league))
print(get_scoreboard_short(league))
print(get_close_scores(league))
#print(get_power_rankings(league))
print(get_power_rankings(league))
print(get_trophies(league))
function="get_final"
bot.send_message("Testing")
Expand All @@ -300,8 +300,8 @@ def bot_main(function):
text = get_scoreboard_short(league)
elif function=="get_close_scores":
text = get_close_scores(league)
#elif function=="get_power_rankings":
# text = get_power_rankings(league)
elif function=="get_power_rankings":
text = get_power_rankings(league)
elif function=="get_trophies":
text = get_trophies(league)
elif function=="get_final":
Expand Down Expand Up @@ -349,9 +349,9 @@ def bot_main(function):
#score update: friday, monday, and tuesday morning at 7:30am local time.
#score update: sunday at 4pm, 8pm east coast time.

#sched.add_job(bot_main, 'cron', ['get_power_rankings'], id='power_rankings',
# day_of_week='tue', hour=18, minute=30, start_date=ff_start_date, end_date=ff_end_date,
# timezone=my_timezone, replace_existing=True)
sched.add_job(bot_main, 'cron', ['get_power_rankings'], id='power_rankings',
day_of_week='tue', hour=18, minute=30, start_date=ff_start_date, end_date=ff_end_date,
timezone=my_timezone, replace_existing=True)
sched.add_job(bot_main, 'cron', ['get_matchups'], id='matchups',
day_of_week='thu', hour=19, minute=30, start_date=ff_start_date, end_date=ff_end_date,
timezone=game_timezone, replace_existing=True)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8==3.3.0
apscheduler>=3.3.0
requests>=2.0.0,<3.0.0
ff_espn_api>=1.0.4
ff_espn_api>=1.0.5
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

author_email='[email protected]',

install_requires=['requests>=2.0.0,<3.0.0', 'ff_espn_api>=1.0.4', 'apscheduler>3.0.0'],
install_requires=['requests>=2.0.0,<3.0.0', 'ff_espn_api>=1.0.5', 'apscheduler>3.0.0'],

test_suite='nose.collector',

Expand Down

0 comments on commit dc3709f

Please sign in to comment.