To see less ads Register or Login ----- Daily Fantasy Sports games 18+

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:

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

Post by nickchild »

MoSe wrote:I just posted in another forum (run by my minileague friends):
BTW, did any of you went on to install the leaguetable-enhancing JavaScript I linked to?
I couldn't live without now
Just one liiitle aesthetic enhancement to suggest:
could you perhaps right-align the money values? (Value Bank Total)
so that the decimal comma is in column :)
Thanks for the suggestion MoSe. I have implemented this so it will be in the next update...

User avatar
Moist von Lipwig
FISO Knight
Posts: 18227
Joined: 08 Jun 2011, 16:08
Location: The Eyrie
FS Record: FPL Spring 16 Winner 2010-11. Murfs F1 Predictions 2012 Winner. Pick Quick 2012-13 Winner. SP4s Predictions League A & Champions League

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

Post by Moist von Lipwig »

the wildcard history has always shown the week/date it was played in past seasons, I've not looked at any teams with it earlier than GW5 to know if they just got round to adding it this season now or if its been there all along.

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 »

Transfer points hit has now been added...

I'm pretty sure the logic is sound. I tried to check every possibility as I went along, even finding a few teams who have made 1 single transfer each week...

1. Wildcard last week = 1 free transfer
2. Two or more last week = 1 free transfer
3. Zero transfers last week = 2 free transfers
4. One last week = check back previous gameweeks until;
4a. Wildcard = 1 free
4b. Two or more = 1 free
4c. Zero = 2 free
4d. Reach gameweek 1 with 1 made every week = 1 free

Have I missed anything?

If you find any that you think are wrong please let me know and I will take a look

As I am now retrieving the data, I have added the week the wildcard was played to the rollover of X icon if applicable

And I've now right aligned the money values as suggested by MoSe

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 »

Just updated code again to increase the font size of the squad if the 'extra wide' option is selected

User avatar
liquidfootball2
Dumbledore
Posts: 8672
Joined: 05 Jan 2012, 16:14
FS Record: Best fpl finish 233 in 14/15

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

Post by liquidfootball2 »

I have 'update add-ons automatically' ticked but don't seem to be getting these latest enhancements.

I could be looking at the completely wrong page of course (wouldn't surprise me) so just a check:-

The transfer points hit addition - Is this an extra column in the league table ?

# Team Manager GW TOT Value Bank Total TT GWT WC Captain Live Total P TP DNP

The bank values in the above column under 'Bank' are left justified

There is no increase in font size of the squad (does this refer to the points data view team page or the selection data view team page or even the transfer data view team page?)

It's probably just the latest update not picked up.

Thanks for the good work Nick.

User avatar
bcfc1903
Grumpy Old Man
Posts: 2219
Joined: 27 Sep 2008, 19:49
Location: Bradford. 9 miles west of Scumland.
FS Record: william hill champion 2010, 2012. all-inclusive league winner 2012, second x-league 2012.

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

Post by bcfc1903 »

May I add my limited input, to this extension and it's capabilities.

It's bloody brilliant. Top man. Top efforts.

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 »

liquidfootball2 wrote:I have 'update add-ons automatically' ticked but don't seem to be getting these latest enhancements.
You should be able to manually update the script via the Greasemonkey menu. Click the arrow next to the monkey head in tool bar and select 'Manage User Scripts...' From there you should be able to right click on the script and select 'Find Updates'

Hold fire for a minute though as another update is on it's way...

User avatar
Moist von Lipwig
FISO Knight
Posts: 18227
Joined: 08 Jun 2011, 16:08
Location: The Eyrie
FS Record: FPL Spring 16 Winner 2010-11. Murfs F1 Predictions 2012 Winner. Pick Quick 2012-13 Winner. SP4s Predictions League A & Champions League

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

Post by Moist von Lipwig »

this updates more often than Adobe.

If only Adobe was anywhere near as useful as this :lol:

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 »

Added sort capability to the table. Just click any of the column headers...

Found a free javascript so credit due:
SortTable
version 2
7th April 2007
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/" onclick="window.open(this.href);return false;
Thanks to many, many people for contributions and suggestions.
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html" onclick="window.open(this.href);return false;
This basically means: do what you want with it.
So thanks Stuart and the many, many others!

I'd appreciate it if any non-Firefox users could confirm the sorting works and doesn't break anything else...

User avatar
liquidfootball2
Dumbledore
Posts: 8672
Joined: 05 Jan 2012, 16:14
FS Record: Best fpl finish 233 in 14/15

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

Post by liquidfootball2 »

nickchild wrote:
liquidfootball2 wrote:I have 'update add-ons automatically' ticked but don't seem to be getting these latest enhancements.
You should be able to manually update the script via the Greasemonkey menu. Click the arrow next to the monkey head in tool bar and select 'Manage User Scripts...' From there you should be able to right click on the script and select 'Find Updates'

Hold fire for a minute though as another update is on it's way...
Sorted, 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 »

Update: Changed initial sort to descending so the larger values appear at the top. Makes sense for everything except the points hit column

Edit: Update: Added hidden value so sorting on points hits shows the largest hit first

Edit: Update: Added hidden value so sorting on wildcard availability takes the gameweek it was played into account (if applicable)

User avatar
MoSe
Dumbledore
Posts: 9550
Joined: 10 Sep 2014, 12:25
Location: next door S.Siro stadium
FS Record: FISODAS CUP Winner Season 25
FISO H2H Winner: 15/16 Div2 - 16/17 Div1
FISO Mirror: 16/17 PL Winner

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

Post by MoSe »

everything works!

for Chrome:
I had "update scripts daily" but I had the same to manually check for the update
after importing 1.8, there was a warning about compatibilty setting, which didn't happen for 1.6 (windows 7 PC)
had to enter Chrome Settings Extensions, enable the URL access, and input the browser appdata path from my user profile...

just followed instructions, and it worked :)

User avatar
jeffmcgow
Dumbledore
Posts: 7624
Joined: 13 Oct 2005, 18:44
FS Record: FPL - FISO Mirror League 1st 2015-16 | Sun - Cheap as Chips Conference 1st 2014-15 & 2015-16

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

Post by jeffmcgow »

Thanks for the work involved in getting the points hit column added - it's very useful.

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 »

Just realised the 'Live total' doesn't take the weeks transfer points hit into account...

FPL don't factor the hit into the 'Total score' until the first update in a gameweek.

So I have updated the script to include previous hit points when calculating the live total if the gameweek score is 0.

You will see the live total reduce after the score first loads as the transfer history is processed.

Again, if you find any you think are incorrect please let me know.

I have left the live week score alone so this will reflect purely the points scored excluding points hits.

User avatar
GobiLux
FISOhead
Posts: 516
Joined: 29 Jul 2013, 10:14
Location: your sister's closet

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

Post by GobiLux »

Great tool, works on Opera with violent monkey!

User avatar
MoSe
Dumbledore
Posts: 9550
Joined: 10 Sep 2014, 12:25
Location: next door S.Siro stadium
FS Record: FISODAS CUP Winner Season 25
FISO H2H Winner: 15/16 Div2 - 16/17 Div1
FISO Mirror: 16/17 PL Winner

MOUSEOVER INFO!!!

Post by MoSe »

I hadn't realised so far that you can get additional info by passing the mouse over certain data!

- on played WC it tells you the GW it had been played
- on the Captain it tells you the VC
- on the P (Players Played) column it lists your pitch players who already played
- on the TP (Players to Play) column it lists your pitch players who still have to play (see attached Begovic Shawcross tonite for Walrus)
- on the DNP last column it lists your Pitch Players who Did Not Play

Only thing it lacks now is to list the Bench points/players who can sub in for those DNP :mrgreen:

...er... this is NOT a request :) just an idea thrown on the table
I understand it could become a bit complex. with the 3 defenders rule and, in case the eligible bencher still has to play himself too

It's just, as FPL will only count subs in at the end of all matches, half my minileague has DNPs and I still have to click their individual pages.
Turns out most of them are straightforward and finalised subs (i.e eventual TP won't indfluence them), and I have to complement in my head the Live Score with sub points....
:)

BTW,
I extend here the comment by my minileague admin who's not on FISO:
I have that plugin now btw, it's really good.

User avatar
Brightwater
Grumpy Old Man
Posts: 2795
Joined: 01 Dec 2005, 22:15
Location: ***** BrightwaterVilla.co.uk ***** lakeside at Lake Berkley Orlando /parkrunning
FS Record: 21 cash league 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 »

The most useful column for me, as a habitual late WC player, is WC status. Nick - I take it you will be updating to allow for all combinations during and after the winter WC window. 8-)

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: MOUSEOVER INFO!!!

Post by nickchild »

MoSe wrote:I hadn't realised so far that you can get additional info by passing the mouse over certain data!
Correct!

I started adding bits to some rollovers after the vice captain was requested and I didn't feel it warranted it's own column. The wildcard played data added after I added a call to the transfer history page and the players played/to play/didn't play just made sense as it was semi worthless without the additional info.
MoSe wrote:Only thing it lacks now is to list the Bench points/players who can sub in for those DNP :mrgreen:

I understand it could become a bit complex. with the 3 defenders rule and, in case the eligible bencher still has to play himself too
You're right that this would take a bit of coding to arrive at the right player(s) but should be no more complex that the algorithm for calculating point hits... Maybe I will add this in when I get another free hour.

For now, you know you can click the left hand position movement indicator to view each teams starting XI and bench? Will make it a bit easier than going into each team...

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 »

Brightwater wrote:The most useful column for me, as a habitual late WC player, is WC status. Nick - I take it you will be updating to allow for all combinations during and after the winter WC window. 8-)
Yep already thought about this one but won't be able to implement until the 2nd wildcard is available and I can check how the info for both wildcards is presented. But yes... it'll be added!

User avatar
MoSe
Dumbledore
Posts: 9550
Joined: 10 Sep 2014, 12:25
Location: next door S.Siro stadium
FS Record: FISODAS CUP Winner Season 25
FISO H2H Winner: 15/16 Div2 - 16/17 Div1
FISO Mirror: 16/17 PL Winner

Re: MOUSEOVER INFO!!!

Post by MoSe »

nickchild wrote:For now, you know you can click the left hand position movement indicator to view each teams starting XI and bench? Will make it a bit easier than going into each team...
WOW! It did't came to my mind! ....and iof you don't advertise the features you developed... :)

DEBUG: those on odd lines have opaque bkg, but for those on even lines it's transparent... or maybe it has to do with the alternate line coloring...
Immagine.JPG
STILL, I need to enter the players page, or a match detailed stats, to found out the points someone else's bencher scored :)
You do not have the required permissions to view the files attached to this post.

User avatar
Aldershot Rejects
Dumbledore
Posts: 9586
Joined: 03 Aug 2011, 17:15
Location: Kent
FS Record: 5th Metro (2010-11); 146 - Sky (2015-16); 218 - Sky (2014-15); 386 - Sky (2020-21); 636 - FPL (2017-18); last 16 Sky Cup (2018-19)

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

Post by Aldershot Rejects »

Just discovered this thread. Wow! Thanks ever so much, will save me a lot of clicking every weekend.

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: MOUSEOVER INFO!!!

Post by nickchild »

MoSe wrote:
nickchild wrote:For now, you know you can click the left hand position movement indicator to view each teams starting XI and bench? Will make it a bit easier than going into each team...
WOW! It did't came to my mind! ....and iof you don't advertise the features you developed... :)

DEBUG: those on odd lines have opaque bkg, but for those on even lines it's transparent... or maybe it has to do with the alternate line coloring...
Immagine.JPG
STILL, I need to enter the players page, or a match detailed stats, to found out the points someone else's bencher scored :)
I am now pulling the players scores to add to the rollover of each name, but this will need some tweaking once the game goes live so I will release an update over the weekend

I've also made the background of the team popups white for each. It was inheriting the background colour of the row which came out white in Firefox. Since adding the sort option the rows seem to switch colours anyway so white for all will do.

MrrDrr
Treebeard
Posts: 115
Joined: 15 Aug 2013, 13:20

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

Post by MrrDrr »

Great work.

Thank you very much, Nick.

User avatar
snakzz
Grumpy Old Man
Posts: 3613
Joined: 03 Oct 2012, 08:56

Re: MOUSEOVER INFO!!!

Post by snakzz »

MoSe wrote:
nickchild wrote:For now, you know you can click the left hand position movement indicator to view each teams starting XI and bench? Will make it a bit easier than going into each team...
How does this work?

User avatar
MoSe
Dumbledore
Posts: 9550
Joined: 10 Sep 2014, 12:25
Location: next door S.Siro stadium
FS Record: FISODAS CUP Winner Season 25
FISO H2H Winner: 15/16 Div2 - 16/17 Div1
FISO Mirror: 16/17 PL Winner

Re: MOUSEOVER INFO!!!

Post by MoSe »

nickchild wrote:I am now pulling the players scores to add to the rollover of each name, but this will need some tweaking once the game goes live so I will release an update over the weekend
I figure the playing players points are already tallied in the Live Score, and that can perfectly do. What would be useful it's just the points for the players on the bench, which are not handy otherwise :)

User avatar
MoSe
Dumbledore
Posts: 9550
Joined: 10 Sep 2014, 12:25
Location: next door S.Siro stadium
FS Record: FISODAS CUP Winner Season 25
FISO H2H Winner: 15/16 Div2 - 16/17 Div1
FISO Mirror: 16/17 PL Winner

Re: MOUSEOVER INFO!!!

Post by MoSe »

snakzz wrote:How does this work?
for instance in the image attached in my yesterday post above, you just click on the red/green arrows on the left
mind, they're not rollover: you click to switch a line on, click again to switch it off

User avatar
SuperGrover
Grumpy Old Man
Posts: 1540
Joined: 12 Sep 2012, 15:38
Location: Chicago, USA

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

Post by SuperGrover »

This is awesome. Helps so much. Great work and I say that as a former dev myself!

Quick question as you are in the "FPL dev space" (if that even exists):

Have you seen a tool that can show you the difference in your players and your league mates? Something that shows count of similar players/starters? I have been contemplating writing one myself but wondered if one existed out there already.

Again, kudos on the plug-in. I absolutely love it.

User avatar
snakzz
Grumpy Old Man
Posts: 3613
Joined: 03 Oct 2012, 08:56

Re: MOUSEOVER INFO!!!

Post by snakzz »

MoSe wrote:
snakzz wrote:How does this work?
for instance in the image attached in my yesterday post above, you just click on the red/green arrows on the left
mind, they're not rollover: you click to switch a line on, click again to switch it off
Ah AWESOME :D

Any way that I can press one button do to this for all teams?

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 »

SuperGrover wrote:This is awesome. Helps so much. Great work and I say that as a former dev myself!

Quick question as you are in the "FPL dev space" (if that even exists):

Have you seen a tool that can show you the difference in your players and your league mates? Something that shows count of similar players/starters? I have been contemplating writing one myself but wondered if one existed out there already.

Again, kudos on the plug-in. I absolutely love it.
I was thinking about adding a summary window, showing most selected players along with any differentials. I could take this further to show all players selection counts but not sure how to display the data to make it useful...

Another option would be to have a free-text field allowing the user to search for a specific player with an extra column showing if this player is in the starting xi / bench / captain / vice.

Something like this almost needs a separate GUI

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: MOUSEOVER INFO!!!

Post by nickchild »

snakzz wrote:
MoSe wrote:
snakzz wrote:How does this work?
for instance in the image attached in my yesterday post above, you just click on the red/green arrows on the left
mind, they're not rollover: you click to switch a line on, click again to switch it off
Ah AWESOME :D

Any way that I can press one button do to this for all teams?
I will try to get this added in for the weekends update

View Latest: 1 Day View Your posts
Post Reply

Return to “Fantasy PremierLeague.com (FPL)”