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
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 »

nickchild wrote:Ah! I was looking at my team via a league and was running on a different URL (/entry*). I have added (/my-team*) as well now
I confirm "FPL get player info" works under Chrome (+Tampermonkey oc)

actually in /entry/*/event-history/x/ you have points breakdown for past GW,
there the four columns PPG PP90 PPH PPA show but are all blanks

The page where the 4 stats are really useful is in the Pick Team page for upcoming GW,
and that's always /my-team/ regardless where you access it from

So I went into Tampermonkey, and applied a User Exclusion on /entry* and it worked :)
___

you might even better highlight your excellent work,
by adding the "FPL get player info" in the OP too, along with the "FPL get team info"
there's the risk it gets overlooked, embedded here in the middle of the thread
Image

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:
nickchild wrote:actually in /entry/*/event-history/x/ you have points breakdown for past GW,
there the four columns PPG PP90 PPH PPA show but are all blanks
These aren't blank for me... it should work when viewing another users team as well

But you're not seeing any values? Any javascript errors?

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 scripts to realign everything centrally. Had wandered off left since the ads in the background had gone. Might need further tweaking if they return...

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 »

nickchild wrote:
MoSe wrote:actually in /entry/*/event-history/x/ you have points breakdown for past GW,
there the four columns PPG PP90 PPH PPA show but are all blanks
These aren't blank for me... it should work when viewing another users team as well
But you're not seeing any values? Any javascript errors?
I wasn't seeing any values, nor cell shading or borders.
I did refresh, closed and reopened the browser, checked in Tampermonkey and didn't notice any warning or error

Now I re-enabled it, checked another user's team (GW5), and it works...
navigate a bit back and forth in that user's past GW... sometimes the columns are blank, but show after a wait
getting back on his GW5 a couple of times columns were not even there, otherwise they showed regularly

I understand it can be useful to check player stats from your rivals... :)
as per my team name, I can thus COPY :wink: their choices: monkey see, monkey do - then REGRET I did it :lol:
___

But as for my own team, no matter how long I try, wait, refresh, reopen, columns are always blank, for any GW
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 »

Bug fixed: When team name was ALL special characters (eg. Чудо Калнциемс) the id was null, so it's now using the FPL team ID which should fix all

sir_skillalot
Treebeard
Posts: 118
Joined: 15 Aug 2014, 01:09

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

Post by sir_skillalot »

This is a really great script! Should be another way to get ahead in mini league.

Do you think there is any way to display which teams are taking a points hit? For example; If someone has made 2 GWT then it would be useful to know whether or not they took a points hit to do it. Would also be interesting to see how many points were lost to transfers over the season.

Just a thought, other than that great work!

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 »

sir_skillalot wrote:Do you think there is any way to display which teams are taking a points hit? For example; If someone has made 2 GWT then it would be useful to know whether or not they took a points hit to do it. Would also be interesting to see how many points were lost to transfers over the season.
I think it's probably possible but as the data is not directly available I would need to work this out manually by looking at the gameweek history and counting back the number of transfer per week until I hit their wildcard, a 0 transfer week or a 2+ transfer week... I would also need to discover if their wildcard is currently active. I'm not sure if this is possible. I know the wildcard status will say 'Available' or 'Played' but I'm not sure if it will show as 'Active'. Is anyone on a wildcard so I can check? Or know a team that is wildcarding?

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 really is a great piece of work. The fact you just did it as a time killer as you were up early is funny.

Buxton
Kevin and Perry
Posts: 42
Joined: 01 Aug 2014, 16:15

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

Post by Buxton »

nickchild wrote: I would also need to discover if their wildcard is currently active. I'm not sure if this is possible. I know the wildcard status will say 'Available' or 'Played' but I'm not sure if it will show as 'Active'. Is anyone on a wildcard so I can check? Or know a team that is wildcarding?
Yes Nick the wildcard status does come up as "Active" - here's an example:

http://fantasy.premierleague.com/entry/ ... history/5/" onclick="window.open(this.href);return false;

Congrats on the work so far by the way - great stuff 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: Greasemonkey script to display team data on FPL league p

Post by nickchild »

Thanks Buxton very useful.

I have already now been able to add another status of 'Active' to the wildcard availability column. This is displayed as an exclamation mark symbol.

I will look into extracting the transfer hit points data you have requested...

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 »

Moist von Lipwig wrote:This really is a great piece of work. The fact you just did it as a time killer as you were up early is funny.
:D Yep - you can thank my cat, Didi (yes, he was named shortly after the 2012 Champions League final)

User avatar
murf
FISO Viscount
Posts: 109448
Joined: 13 Oct 2005, 18:28
Location: here
FS Record: Once led TFF. Very briefly.
Contact:

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

Post by murf »

nickchild wrote:
Moist von Lipwig wrote:This really is a great piece of work. The fact you just did it as a time killer as you were up early is funny.
:D Yep - you can thank my cat, Didi (yes, he was named shortly after the 2012 Champions League final)
2005 surely :wink:

User avatar
Surprised
FISO Jedi Knight
Posts: 26528
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 »

nickchild wrote:
Moist von Lipwig wrote:This really is a great piece of work. The fact you just did it as a time killer as you were up early is funny.
:D Yep - you can thank my cat, Didi (yes, he was named shortly after the 2012 Champions League final)

Let's hope Didi does it again!

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 »

Surprised wrote:Let's hope Didi does it again!
Which one?!

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 »

Thanks Nick, brilliant work - I have it working in firefox and chrome now and find it really 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 »

nickchild wrote:
sir_skillalot wrote:Do you think there is any way to display which teams are taking a points hit? For example; If someone has made 2 GWT then it would be useful to know whether or not they took a points hit to do it. Would also be interesting to see how many points were lost to transfers over the season.
I think it's probably possible but as the data is not directly available I would need to work this out manually by looking at the gameweek history and counting back the number of transfer per week until I hit their wildcard, a 0 transfer week or a 2+ transfer week... I would also need to discover if their wildcard is currently active. I'm not sure if this is possible. I know the wildcard status will say 'Available' or 'Played' but I'm not sure if it will show as 'Active'. Is anyone on a wildcard so I can check? Or know a team that is wildcarding?
Was just about to have a go at this, but thinking through the logic there is one problem...

In order to determine the points hit I need to get the number of free transfers available for the team. I can do this by looking back at the number of transfers from previous weeks. If the last week is more than 1, I know they have just 1 free transfer, if it's 0 they must have 2 free transfers and if it's 1, it's possible they are carrying a free transfer so I need to check the previous gameweek and apply the same logic.

This is fine, except for the week the wildcard is played; when the number of transfers shows as 0, but you only get 1 free transfer the week after you play your wildcard. There is also no way to see which week a team played their wildcard so I don't see a way around this...

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 »

Aha! I could read the transfer history and determine which week the wildcard was played based on actual number of transfers vs the reported number in the gameweek history.

This would triple the number of AJAX calls for just a single value... I'll do some tests and see if this is feasible... I can see us bringing FPL Towers down on Saturday at 11am!

User avatar
Surprised
FISO Jedi Knight
Posts: 26528
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 »

How come this auto updates now?

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 »

Surprised wrote:How come this auto updates now?
As in: when I updated the script you automatically got the new version?

User avatar
Surprised
FISO Jedi Knight
Posts: 26528
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 »

nickchild wrote:
Surprised wrote:How come this auto updates now?
As in: when I updated the script you automatically got the new version?

Yes

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 »

Yeah just been looking into it.

It seems they added auto update support to Greasemonkey a few years ago: http://www.greasespot.net/2012/02/autom ... me-to.html" onclick="window.open(this.href);return false;

That sounds like you could turn them off completely (Enable automatic update checking of scripts).

Now it seems like the option (via Greasemonkey Options...) is to 'Require secure updates' which I guess you want to leave on.

Not sure if you can turn it off at all. I wasn't aware it even did this...

Are you using Greasemonkey or are you not a Firefox user?

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 »

Found it...

If you go to 'Manage User Scripts...' and click on the cog in the top right there are update options in there.

So you can turn 'Auto' off and I presume when you right click on a script in the menu you are able to select 'Find Updates' ? All mine are greyed out as they are all my own but I presume if you've installed from a URL you will have this option.

User avatar
Surprised
FISO Jedi Knight
Posts: 26528
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 »

Strange
I have it on auto update (never knew I could or that I did) but your script did not auto update the first few times. Maybe it was because I did a manual update when you updated this thread and I did that before Greasemonkey checked for updates

User avatar
Fuzzy
Grumpy Old Man
Posts: 1699
Joined: 24 Jul 2010, 10:28
Location: on a different wavelength
FS Record: meh

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

Post by Fuzzy »

This is 7 different kinds of awesome! Is massively helpful for running my minileagues.

Terrific work nick - we're all grateful for what you have done here. :mrgreen:

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 »

Absolute pleasure...

Pleased so many are finding this useful

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 »

Wahaay - I have managed to get it working on laptop. A great tool. Thanks Nick. 8-) :D

User avatar
From4corners
FISO Jedi Knight
Posts: 20107
Joined: 24 Aug 2009, 22:32
Location: London

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

Post by From4corners »

Just found time to read through this thread and boy, is this fantastic or what?! :D Thank you very much, Nick! Great, GREAT tool!

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 »

This is beautiful!
Thank you!

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 »

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 :)

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 »

Edit: Removed long rambling post about me getting confused over the 'Wildcard history' data on the transfers page
Last edited by nickchild on 26 Sep 2014, 00:47, edited 2 times in total.

View Latest: 1 Day View Your posts
Post Reply

Return to “Fantasy PremierLeague.com (FPL)”