View Latest: 1 Day | FISO Injury Search

Greasemonkey script to display team data on FPL league page

A Fantasy Football forum for news on fantasy football games run by the Premierleague (FPL).
Post Reply
User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Greasemonkey script to display team data on FPL league page

Post by nickchild » 20 Sep 2014, 16:53

Been working on this script today after being woken up early and not getting back to sleep...

From the league page in FPL it adds the following data to the table for each team:

- Live gameweek score
- Live total score (including any transfer hits for the gameweek)
- Gameweek captain (and vice-captain on rollover)
- Team value
- Bank funds
- Total value (team + bank)
- Total transfers
- Gameweek transfers
- Gameweek transfers points hit
- Wildcard availability
- Associated H2H league position (see below)
- Starting XI and bench (see below)
- Playing stats (rollover to show who has played, yet to play, didn't play, plus number of games remaining in the case of a double gameweek)

NEW FOR 2015/16
- Chips - shows which chips have been played with an alert if one is active for the current gameweek)
- Quick picks - quickly select a default data set (see below)

Each of these values can easily be turned on or off using a panel below the league. There are also shortcuts to turn all options on/off as well as two quick picks; one for 'Live Data' which is best used as soon as a gameweek goes live (shows captain, live points, playing stats and chip info) and the other for 'Team Info' which is best used once all games are complete and the build up to the next gameweek has started (transfer stats, wilcard and chip info and team/bank value).

You can sort the table by clicking any of the column headers.

You can see the starting XI and bench for each team by clicking on the corresponding position movement indicator (far left arrow icon). Click on the column header to show all teams squads. You can hover over each player here to see their current gameweek score.

The 'Associated H2H league position' is calculated by looking for a H2H league name that starts the same as the current league. For example, FISO X League 2014/15 has a H2H named the same, I am also in another league with an associated H2H - '£10 league option' which maps to '£10 league option:H2H'.

If you think you might find this useful, you will need the Firefox add-on 'Greasemonkey'. Once this is enabled you can install my script by clicking the following link: https://openuserjs.org/install/nickchil ... fo.user.js


Version 1.1 update: Added an option to view the starting XI and bench

Version 1.2 update: Added option to display 'Live Total' based on the live gameweek score.

Version 1.3 update: Fixed a bug with player or team names with special character returning no data.

Version 1.4 update: Added option to make table and containers extra wide so everything fits cleanly.

Version 1.5 update: Added option to show how many players are left to play in the gameweek (and those who have already played). Added 'Reload' button to config panel.

Version 1.6 update: Combined played/to play into one option and added 'didn't play' to the table (enabled under same option).

Version 1.7 update: Added option to show the points hits acquired from transfers for the gameweek.

Version 1.8 update: Added sort capability to the table.


I've also now made a start on another script to show extra info in the 'Data View' on the 'My Team' page. Will also work when viewing other players teams. At the moment it adds PPG, PP90 and average H/A scores. If it grows much bigger I will add a similar config but for now it's just all or nothing and can be enabled/disabled via the Greasemonkey menu. Install it here: https://openuserjs.org/install/nickchil ... fo.user.js

The script may work in other browsers using the equivalent extension (Safari - GreaseKit, IE - Trixie, Chrome - native) but these are all untested.

Edit: Has now been confirmed to work with Tampermonkey in Chrome (thanks Dram!).

Please let me know if you come across any bugs or suggestions for extra features.

Enjoy!
You do not have the required permissions to view the files attached to this post.
Last edited by nickchild on 22 Aug 2015, 17:41, edited 18 times in total.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 20 Sep 2014, 17:10

Bug 1 fixed!

The Associated H2H league position was actually displaying the position of the team in their first H2H league in the list.

Fixed now to use correct league

Only 3 installs so far, but you may want to reinstall if you're using this feature and are one of those early ones

User avatar
Surprised
FISO Jedi Knight
Posts: 25551
Joined: 13 Oct 2005, 18:32
Location: Home
FS Record: TFFOSM MotW in 2008 and MotM in 2003. 78th overall in TFFO for 2002/3 and 2003/4

Re: Greasemonkey script to display team data on FPL league p

Post by Surprised » 20 Sep 2014, 17:24

Looks pretty good!

User avatar
deafleopard
Red & Blue Braces
Posts: 331
Joined: 07 Aug 2010, 15:13
FS Record: 334th in FPL 2013-2014. Top 2k this campaign

Re: Greasemonkey script to display team data on FPL league p

Post by deafleopard » 20 Sep 2014, 19:50

This is awesome thanks Nick!

Especially like the live score, great at this time of a gameweek waiting for FPL databases to update.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 20 Sep 2014, 20:09

No probs deafleopard, glad you like it!

I have just added an option to view the starting XI and bench for each team by clicking on the corresponding position movement indicator.

You will need to reinstall using the link in the OP to update an old version.

User avatar
Surprised
FISO Jedi Knight
Posts: 25551
Joined: 13 Oct 2005, 18:32
Location: Home
FS Record: TFFOSM MotW in 2008 and MotM in 2003. 78th overall in TFFO for 2002/3 and 2003/4

Re: Greasemonkey script to display team data on FPL league p

Post by Surprised » 20 Sep 2014, 20:49

Love it!
Any chance of adding a live updated total?
I know it's easy to just add the total and live score in your head but a column would make it easier (especially after a few glasses of red on a Saturday night!)

User avatar
J0E_90
Treebeard
Posts: 108
Joined: 14 Aug 2013, 16:17

Re: Greasemonkey script to display team data on FPL league p

Post by J0E_90 » 20 Sep 2014, 21:09

Hi Nick, This is amazing! So helpful!

I am quite computer illiterate so I don't know if the following is a bug or just stupidity on my part but all the additional details for my team are not coming up in league tables.

Regardless this is such a helpful add-on and saves so much time

EDIT: Upon further investigation, the additional details don't show up for anyone with an apostrophe in their name.
You do not have the required permissions to view the files attached to this post.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 20 Sep 2014, 21:24

OK, that's done, however it's not accurate at this precise moment as FPL are updating their data;

The 'live total' is taken from values from the existing table like so: TOT + (Live - GW)

So it is taking the reported total score from FPL, then adding the difference between the Live score and the reported GW score.

This way it will work during matchdays 2 and 3 by taking the total and GW scores at the start of the day into account.

However, once FPL start to update their data, the GW score is updated before the TOT, so the 'live total' will simply reflect TOT during this time. FPL's warning message will let you know if this is the situation: League tables are currently being re-calculated. The table below may still contain old data.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 20 Sep 2014, 23:27

J0E_90 wrote:Upon further investigation, the additional details don't show up for anyone with an apostrophe in their name.
Thanks for letting me know. The reason it was doing this is that the players name contains HTML characters on the team page where it doesn't on the league page (so the apostrophe was showing as ' on the league page but ' on the team page).

As I was using the players name as the identifier it wasn't finding a match when the data was being returned.

I knew I had to change this anyway just in case there are 2 people with the same name in 1 league, so it is using player and team name now. You just forced me to do it sooner!

This is now fixed so reinstall for the update

garypallister
FISOhead
Posts: 815
Joined: 02 Mar 2006, 19:32

Re: Greasemonkey script to display team data on FPL league p

Post by garypallister » 20 Sep 2014, 23:56

Nick, this is awesome!

This is gonna save me 1000 clicks per week, well done :D

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 21 Sep 2014, 00:18

Yep that was the main factor behind writing the script in the first place. Checking everyone's team value and how many transfers they've made, then everyone's captain, then everyone's score once it all gets going.... then you forget it all and have to start again. It's all there now!

I've just added another option to allow you to increase the width of the table and the containing boxes. It was annoying me when lots of options were enabled and the table was overlapping the league table.

It also means less chance of players/team/captains names wrapping and making the table look ugly with double height rows...!

Dram
Cheetah
Posts: 9
Joined: 11 Oct 2009, 00:23

Re: Greasemonkey script to display team data on FPL league p

Post by Dram » 21 Sep 2014, 00:26

This is fantastic, thanks!

Just thought I'd share that it works perfectly on Chrome with the "Tampermonkey" extension.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 21 Sep 2014, 00:30

Thanks Dram, I'll update the OP.


I have fixed a bug with the H2H rollover. It had the name of my H2H league that I had originally hardcoded before changing it to check for an associated H2H based on league names. I haven't updated the live script yet, but the fix will be there in the next version

jcurtis23
Kevin and Perry
Posts: 15
Joined: 21 Aug 2013, 14:35

Re: Greasemonkey script to display team data on FPL league p

Post by jcurtis23 » 21 Sep 2014, 03:07

Thanks man this works a treat!

User avatar
Bergkamp_22
FISOhead
Posts: 696
Joined: 18 Aug 2012, 14:17
Location: London
FS Record: 2,263 points

Re: Greasemonkey script to display team data on FPL league p

Post by Bergkamp_22 » 21 Sep 2014, 04:02

Amazing. Took me a while to properly check this out but so worth it. So simple yet efficient. Really appreciated thank you! 8-)

kung_yoda
Wideboy
Posts: 78
Joined: 06 Jan 2014, 12:57

Re: Greasemonkey script to display team data on FPL league p

Post by kung_yoda » 21 Sep 2014, 05:22

Can someone explain how this works?
Iv clicked the link and can read the script.
I read something about tempermonkey, installed it, but then what?

Im not that much in to computers and no hacker.

ID be glad if somone could hell me out.

Regards

mike_d99
Grumpy Old Man
Posts: 2513
Joined: 13 Oct 2005, 18:50
Location: cut down like a vegetable by your hard kickin mother who's an animal
FS Record: 269th TFF 08/09, 11th TFFO 08/09, 49th TFFE 08/09, 50th Elephant 10/11, 92nd Sky Sports 10/11

Re: Greasemonkey script to display team data on FPL league p

Post by mike_d99 » 21 Sep 2014, 08:16

Thanks for this Nick :)

User avatar
Brightwater
Grumpy Old Man
Posts: 1571
Joined: 01 Dec 2005, 22:15
Location: ***** BrightwaterVilla.co.uk ***** ...Lakeside at Lake Berkley Orlando...parkrunning
FS Record: 20 cash lg wins CYKI 08/09 4th, 09/10 8th. 12/13 Sky 56th, FPL FISO X League winner. 2014 UFPL Beta 7th.
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by Brightwater » 21 Sep 2014, 08:55

Can you please help an old mainframe dinosaur? :?

On my Nexus 7 running Chrome I clicked the link, a file downloaded, but won't open.

User avatar
loosecannon85
Grumpy Old Man
Posts: 1000
Joined: 14 Aug 2008, 12:56

Re: Greasemonkey script to display team data on FPL league p

Post by loosecannon85 » 21 Sep 2014, 09:22

Very handy! In flash I can see that in my position of 5th in the fiso league the people head of me are all captaining Costa and me putting the arm banned on Ageuro is a real differential! This could go horribly wrong! :lol:

User avatar
loosecannon85
Grumpy Old Man
Posts: 1000
Joined: 14 Aug 2008, 12:56

Re: Greasemonkey script to display team data on FPL league p

Post by loosecannon85 » 21 Sep 2014, 09:24

Brightwater wrote:Can you please help an old mainframe dinosaur? :?

On my Nexus 7 running Chrome I clicked the link, a file downloaded, but won't open.

You need grease monkey, not sure if its compatible with chrome or not. The script manipulates they way the FPL page is displayed.

User avatar
Tall Paul
Dumbledore
Posts: 5537
Joined: 27 Aug 2008, 12:57

Re: Greasemonkey script to display team data on FPL league p

Post by Tall Paul » 21 Sep 2014, 10:27

Great stuff! Thanks Nick.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 21 Sep 2014, 11:18

Glad this is being so well received. Think I might try to add a column showing how many players each team has left to play so you don't need to trawl through each starting XI. I say 'trawl' - it's hardly that any more! But a quick glance I think would be useful...

For those struggling to install:

You need to install a separate add-on for your browser first. I have built this using Greasemonkey in Firefox so I would suggest you go that route. In theory it should work in Safari and Chrome but I haven't tested these myself (Dram has said it worked for him using Tampermonkey in Chrome).

Here is the step-by-step guide to use this in Firefox:

1. Download Firefox if you haven't already - http://www.getfirefox.com

2. Launch Firefox

3. Install Greasemonkey
3a. Visit https://addons.mozilla.org/en-US/firefo ... asemonkey/" onclick="window.open(this.href);return false;
3b. Click 'Add to Firefox' button
3c. This may or may not require you to restart the browser but do so anyway just in case
3d. You should now see a little monkey face icon in your toolbar. Click the arrow next to it for the Greasemonkey menu and make sure it is enabled (you can also enable/disable by clicking the face).

4. Install my custom user script
4a. Click the following link - https://openuserjs.org/install/nickchil ... fo.user.js
4b. If you have successfully installed Greasemonkey you will now get a dialog window popup asking you to confirm install of 'FPL get team info'
4c. If the file attempts to download instead of installing via Greasemonkey, then you didn't do parts 1-3 correctly.

5. Visit any league on the FPL site to see the extra stats


Feel free to try and replace Firefox and Greasemonkey for the following browsers and let me know if you have any luck:

Chrome - Tampermonkey (https://chrome.google.com/webstore/deta ... fkfo?hl=en" onclick="window.open(this.href);return false;)
Safari - Greasekit (http://8-p.info/greasekit/" onclick="window.open(this.href);return false;) - sounds like you may need to install SIMBL too (link on same page)

I won't suggest IE as there is bound to be bits that are broken but by all means if you are, for some reason, bound to IE there may be an equivalent add-on you can try.

User avatar
asm_fanz
Grumpy Old Frog
Posts: 2846
Joined: 07 Sep 2013, 13:36

Re: Greasemonkey script to display team data on FPL league p

Post by asm_fanz » 21 Sep 2014, 11:29

Working for me on Chrome. Thanks for that, fantastic tool :wink:

User avatar
Mav3rick
FISO Knight
Posts: 16825
Joined: 20 Jul 2009, 20:35
FS Record: The stats are dark and full of errors.
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by Mav3rick » 21 Sep 2014, 12:00

It's really nice, and working like a charm in Chrome. Thanks for sharing it.

User avatar
Brightwater
Grumpy Old Man
Posts: 1571
Joined: 01 Dec 2005, 22:15
Location: ***** BrightwaterVilla.co.uk ***** ...Lakeside at Lake Berkley Orlando...parkrunning
FS Record: 20 cash lg wins CYKI 08/09 4th, 09/10 8th. 12/13 Sky 56th, FPL FISO X League winner. 2014 UFPL Beta 7th.
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by Brightwater » 21 Sep 2014, 12:08

loosecannon85 wrote:
Brightwater wrote:Can you please help an old mainframe dinosaur? :?

On my Nexus 7 running Chrome I clicked the link, a file downloaded, but won't open.

You need grease monkey, not sure if its compatible with chrome or not. The script manipulates they way the FPL page is displayed.
I couldn't get GreaseMonkey download for Chrome to work...I got "send yourself an email reminder"...clicked through back to the same page..

Installed Firefox OK...Clicked GreaseMonkey add on..."GreaseMonkey is incompatible with Firefox 32.0.1".

I can see Nick's script in Firefox...looks good. I will try to get it working on laptop tomorrow. :?
Last edited by Brightwater on 21 Sep 2014, 12:10, edited 1 time in total.

User avatar
Hogmeister
Grumpy Old Hog
Posts: 4589
Joined: 05 Aug 2010, 21:26
Location: Sitting in a tin can, far above the world
FS Record: Ah well, there's always next season...

Re: Greasemonkey script to display team data on FPL league p

Post by Hogmeister » 21 Sep 2014, 12:08

Absolutely brilliant, many thanks for this. Installed straight away in Chrome, no bother :D

User avatar
Mav3rick
FISO Knight
Posts: 16825
Joined: 20 Jul 2009, 20:35
FS Record: The stats are dark and full of errors.
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by Mav3rick » 21 Sep 2014, 12:10

For me (using Chrome) I've just installed the tampermonkey extension then downloaded the script from nickchild's link above, it was recognised automatically by tampermonkey and installed. Two clicks and everything is working fine.

User avatar
andybarrell
Dumbledore
Posts: 7011
Joined: 13 Oct 2005, 18:26
Location: Southend-on-Sea
FS Record: 2013 Licence to Kill Winner
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by andybarrell » 21 Sep 2014, 12:22

works on chrome for me as well...many thanks, will save a lot of clicking during a game week

User avatar
Curwinkle
FISOhead
Posts: 621
Joined: 18 Aug 2013, 23:22

Re: Greasemonkey script to display team data on FPL league p

Post by Curwinkle » 21 Sep 2014, 12:38

I've no idea on scripts but I can only imagine this was pretty time consuming. Thanks very much for sharing this. Much appreciated.

User avatar
nickchild
FISOhead
Posts: 648
Joined: 27 Jul 2006, 23:51
FS Record: 180th Overall FPL and X-League Winner 2008/09
Contact:

Re: Greasemonkey script to display team data on FPL league p

Post by nickchild » 21 Sep 2014, 12:58

Have added option to display the number of players left to play in the gameweek.

The number is based on players who's team haven't played, or players who have played 0 minutes of their teams game. So the number will go down as soon as a player starts playing their fixture in a gameweek.

You can roll over the numbers to see exactly who is left to play.

I can see I will have to tweak this once we get to a double gameweek but will be fine for now.

You can also show the players who HAVE played for the team so far.

Also added a 'Reload' button in the config panel.

View Latest: 1 Day View Your posts
Post Reply

Return to “Fantasy PremierLeague.com (FPL)”

Who is online

Users browsing this forum: Dantheman236, Google [Bot], Highlander12, Ironfist, MorrisonDullforce, Patrician, roverinexile, Sutter Kane and 47 guests