What do I need to set this up?

Simply a computer, GroupMe account, and a Google account. The way this works is a Google Spreadsheet scrapes information from ESPN's public league homepage and a Google Script takes that information and forwards it to GroupMe. Unfortunately since I don't know how your league is set up, it may require some slight script edits on your part but I'm happy to answer any questions to help get it working for you.

Step 1 - Set up your spreadsheet

Copy my spreadsheet here for your own personal use by going to file -> make a copy, and follow the instructions below. The formulas are already where they need to be, so you should be able to simply paste the URLs in the spots it where it says "PUBLIC_SCOREBOARD_URL" or "PUBLIC_TRANSACTIONS_URL" and so on. However, I added instructions to build the spreadsheet from scratch in case something goes wrong in the process.

First, navigate to your league's scoreboard page. Ensure your league is a public league, and that you can hit the page even when you aren't logged in (try accessing the page in an incognito tab). Copy that URL for the scoreboard page, and go to your spreadsheet. To give you an idea about what the formula's I used are doing, the formula =IMPORTHTML("YOUR_PUBLIC_LEAGUE_SCOREBOARD_URL_HERE","table",3) will take the information from the third table on your league homepage and put it in to the spreadsheet. The scoreboards are present on tables 3, 5, 7, 9, and 11 for a 10 man league with 5 games at a time. So in the following cells, paste the following formulas:

And continue on that pattern for as many games as you have. If you have an 8 man league, you wont need that last one.

After that, you'll want to set up your detail statistics information next to each game box. The formula =IMPORTHTML("YOUR_PUBLIC_LEAGUE_SCOREBOARD_URL_HERE","table",4) takes the first game's detail information box containing yet to play, in play, etc.

In the following cells, put the following formulas:

For transactions, you'll need to get the URL of your league's public transactions page. From your public league home page, click 'transactions' at the bottom. Copy that URL, and paste it as follows:

By default, the bot will post all transactions occurring within the last 24 hours (you can use triggers explained below to make the bot post transactions every 24 hours automatically), but will only post 10 to avoid hitting GroupMe's character limit. Many large trades and transactions may still go over this limit. To get alerted if a trigger fails, see how to get trigger failure emails in the triggers section below.

Also included are spreadsheets for each individual player's roster. This is for when I add functionality to warn players that have unset lineups. I haven't finished that feature yet, so for the time being you can leave those sheets as is.

IMPORTANT - In your spreadsheet, go to file -> spreadsheet settings -> recalculation and set it to 'on change and every minute' in order to keep your spreadsheet updated as frequently as possible.

Step 2 - Create a copy of the code for yourself

View the code here, click on "File" and "Make a copy". That copy will be yours to do with and edit as you please. We will work more with that later.

Step 3 - Setting up the bot

Next, go to https://dev.groupme.com/session/new and log in. Click on bots, and then create bot.

Choose your fantasy football chat name, a give the bot a name and (optional) an avatar. We will come back and add the Callback URL.

Once you hit create, copy the bot ID from the next screen, and paste it in to the Google Script where it says "YOUR_BOT_ID_HERE" (parseInput.gs, Line 1). While you're there, change the variables for NUMBER_OF_MATCHUPS_PER_WEEK and NUMBER_OF_PLAYERS_IN_LEAGUE to the correct values for your league.

After that, click "Publish", and set your settings the same way these are set.

Make sure you execute the app as yourself, and make sure Anyone, even anonymous has access to the app. Accept the permissions, and copy the "Current web app URL" from the next screen.

Once you have that URL, go back to your bot and paste that URL in as the callback URL. Once you hit okay, your bot should be good to go. You can test it by going to getScores.gs and hitting the "run button" (making sure it says to run getScores), and ensuring the info is correct.

UPDATE

Some notes about some stupid mistakes I've made -

If you have a league of more than 10 players, you're going to have to move the transaction formula down some and I totally forgot about that. If this is the case for you, in order to get transactions working, change the 19 in row 19 of reportTransactions() var currentTransactionInfo = range.getCell(19 + i, 3).getValue(); to the number of the row that contains your first actual transaction (As in a date, type, player, etc. row, not a header).

Another thing I forgot to mention - This will throw an error if you have no real transactions yet. Once you get transactions, it should work!

Calling the bot

If you are in the chat and you type !scores, the bot will post the current scores. If you type !matchups it will post the current matchups.

Triggers

If you go to "Resources" and then to "Current project triggers", you can set up certain functions to run at certain times. For example, my league has getMatchups() run every Thursday at 5pm before Monday Night Football starts. I also have getScores() run Thursday at midnight, Sunday at 4, 8, midnight, Monday at midnight, and Tuesday at 10am.

I have reportTransactions() set to run every day between 10am and 11am with the previous 24 hour's transactions.

You can set these to run as frequently or as infrequently as you would like.

To get an email if a trigger fails, click on the little 'notification' button under each trigger, and set an email and time for it to send the failure notice to.

Subscribe for new feature alerts

At the moment, I am testing and adding more features. If you want to be alerted when new features are released, feel free to add your email to my mailing list here:

Add your email

Features coming soon

In the works (will be implemented after my personal league's draft Monday):

Disclaimer

This solution is pretty hacky, and is subject to randomly not working. Developing it has been weird because things that should work shouldn't, and things that shouldn't work work perfectly fine. HTML scraping is a very unreliable way to get information, and any slight change to ESPN's site will break this bot. I'll do my best to perform any triage, but consider this a warning. It works very well at the moment, and I hope it stays that way. I hope you enjoy it!

About

Written and maintained by Ian Trapp - iandtrapp@gmail.com for questions