Greasemonkey script to display team data on FPL league page
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
Have just updated the script as it had stopped working for me - part of the HTML code on the team page had changed and was stopping me from grabbing some data. Fortunately it was redundant data (team and player name that I was originally using as an ID) so I have been able to fix it easily.
This update also contains the rollovers for the bench (and starting) players showing their points for the week.
Also fixed a bug that required the 'Live total' to be activated in order to display the gameweek transfer hit points
This update also contains the rollovers for the bench (and starting) players showing their points for the week.
Also fixed a bug that required the 'Live total' to be activated in order to display the gameweek transfer hit points
- 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
- FPL:
Re: Greasemonkey script to display team data on FPL league p
It's stopped updating automatically for me again
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: MOUSEOVER INFO!!!
Have added this option in.snakzz wrote:Ah AWESOMEMoSe wrote:for instance in the image attached in my yesterday post above, you just click on the red/green arrows on the leftsnakzz wrote:How does this work?
mind, they're not rollover: you click to switch a line on, click again to switch it off
Any way that I can press one button do to this for all teams?
There is now a 'T' in the 1st column header. This will toggle all the teams on/off.
- liquidfootball2
- Dumbledore
- Posts: 8672
- Joined: 05 Jan 2012, 16:14
- FS Record: Best fpl finish 233 in 14/15
Re: MOUSEOVER INFO!!!
Great stuff Nick.nickchild wrote:Have added this option in.snakzz wrote:Ah AWESOMEMoSe wrote:for instance in the image attached in my yesterday post above, you just click on the red/green arrows on the leftsnakzz wrote:How does this work?
mind, they're not rollover: you click to switch a line on, click again to switch it off
Any way that I can press one button do to this for all teams?
There is now a 'T' in the 1st column header. This will toggle all the teams on/off.
- sstaffsw
- Grumpy Old Man
- Posts: 1917
- Joined: 08 Dec 2011, 10:47
- Location: Wolverhampton
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Seems to have stopped working for me on Firefox. Anyone else? Brilliant stuff when it's working, hats off to Nick.
- From4corners
- FISO Jedi Knight
- Posts: 20210
- Joined: 24 Aug 2009, 22:32
- Location: London
- FPL:
Re: Greasemonkey script to display team data on FPL league p
It stopped working for me two days ago, downloaded the newer version and working as a charm again. So helpful
- sstaffsw
- Grumpy Old Man
- Posts: 1917
- Joined: 08 Dec 2011, 10:47
- Location: Wolverhampton
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Downloading the new version worked for me, thanks.
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
This may happen from time to time as my script looks for certain markers in the code (tables, element id's, headings etc) in order to pull the data out.sstaffsw wrote:Downloading the new version worked for me, thanks.
So if FPL change/move/remove one of these markers the script will break. It's likely this won't be the last time but I will do my best to fix it ASAP.
Leave a message on this thread if you notice before I do...
- Taff Murray
- Grumpy Old Man
- Posts: 1584
- Joined: 23 Jul 2011, 17:19
- Location: No.1 At the end of the bar
- FS Record: FISO 5AS FA Cup Winner 2016/17, FISO 5AS Champions League Winner 2018/19 Best FPL Pos 11/12 - 9959th
- FPL:
Re: Greasemonkey script to display team data on FPL league p
I am assuming with certain details like Captain choice and transfers this script is not pulling the current choice or can you get at that before the GW deadline passes. i.e. Like normal you cannot view transfers and captain until the GW is active. The assumption is from me that until the deadline passes I am looking at effectively last weeks data. Correct?
- Mav3rick
- FISO Jedi Knight
- Posts: 20858
- Joined: 20 Jul 2009, 20:35
- FS Record: FPL: 1082, 1201, 1800, 10203
The stats are dark and full of errors.
Re: Greasemonkey script to display team data on FPL league p
Yeah that's correct... Would be pretty unfair otherwiseTaff Murray wrote:I am assuming with certain details like Captain choice and transfers this script is not pulling the current choice or can you get at that before the GW deadline passes. i.e. Like normal you cannot view transfers and captain until the GW is active. The assumption is from me that until the deadline passes I am looking at effectively last weeks data. Correct?
- Taff Murray
- Grumpy Old Man
- Posts: 1584
- Joined: 23 Jul 2011, 17:19
- Location: No.1 At the end of the bar
- FS Record: FISO 5AS FA Cup Winner 2016/17, FISO 5AS Champions League Winner 2018/19 Best FPL Pos 11/12 - 9959th
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Mav3rick wrote:
Yeah that's correct... Would be pretty unfair otherwise
And the problem with that is what precisely?
As somebody once told me "If you are not cheating, you are not trying hard enough!!!"
- SuperGrover
- Grumpy Old Man
- Posts: 1540
- Joined: 12 Sep 2012, 15:38
- Location: Chicago, USA
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Yeah I don't see how you could keep it within the same GUI. Be too cluttered IMO, but I was always terrible at GUI design anyway.nickchild wrote: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...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.
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
I have a couple more scrapers i want to code and then might take a look at this next week, unless you do something first!
- 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
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Hi Nick. You've done some fantastic work with league-page enhancements. It really addictive, as soon as I fire up FPL I'm straight on to the league page to see whose made transfers or played a wildcard.
What is the possiblility of showing the Selling Price of a team as well as the TV? I can't see anywhere on the site where an opponent's selling price is shown so maybe this won't be possible.
It's something I'd find useful since it would allow me to see the buying power that rivals have, especially when they come to use their wildcard.
What is the possiblility of showing the Selling Price of a team as well as the TV? I can't see anywhere on the site where an opponent's selling price is shown so maybe this won't be possible.
It's something I'd find useful since it would allow me to see the buying power that rivals have, especially when they come to use their wildcard.
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
No problem Jeff, I'm please you like it!
Unfortunately the data required to see the selling price is not available on the team page.
If the player price change data was available on FPL I could figure it out based on a users transfer history but the best I can get is the players price at the end of a gameweek. This would not give accurate results. Using the CTC data would make it more accurate but as this is on a different URL it is not possible to call that site within this script.
Sorry!
Unfortunately the data required to see the selling price is not available on the team page.
If the player price change data was available on FPL I could figure it out based on a users transfer history but the best I can get is the players price at the end of a gameweek. This would not give accurate results. Using the CTC data would make it more accurate but as this is on a different URL it is not possible to call that site within this script.
Sorry!
- 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
- FPL:
Re: Greasemonkey script to display team data on FPL league p
No problem, Nick. It's good of you to have given it consideration.nickchild wrote:No problem Jeff, I'm please you like it!
Unfortunately the data required to see the selling price is not available on the team page.
If the player price change data was available on FPL I could figure it out based on a users transfer history but the best I can get is the players price at the end of a gameweek. This would not give accurate results. Using the CTC data would make it more accurate but as this is on a different URL it is not possible to call that site within this script.
Sorry!
- SuperGrover
- Grumpy Old Man
- Posts: 1540
- Joined: 12 Sep 2012, 15:38
- Location: Chicago, USA
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Just noticed the tool tip listing of players under P, TP and DNP columns. This is a brilliant way to communicate rosters for each team. Very well done!
- MoSe
- Dumbledore
- Posts: 9562
- 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
if you read back, nick also added a toggle on the up/down arrows in leftmost column, to show a team whole roster
the topleft T toggles the whole table
the topleft T toggles the whole table
- Carlos Kickaball
- Dumbledore
- Posts: 7801
- Joined: 04 Sep 2013, 18:02
Re: Greasemonkey script to display team data on FPL league p
Nick I was wondering if it would be possible if a script could assemble a league of players using their IDs?
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
Could you elaborate...?Carlos Kickaball wrote:Nick I was wondering if it would be possible if a script could assemble a league of players using their IDs?
It's definitely possible but would probably be better as a standalone page.
Why can you not just create a new league?
- MoSe
- Dumbledore
- Posts: 9562
- 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
didn't dare to ask for it....
because not all players in a run-by-hand sidegame would bother to join a ML for it
because not all players in a run-by-hand sidegame would bother to join a ML for it
- Carlos Kickaball
- Dumbledore
- Posts: 7801
- Joined: 04 Sep 2013, 18:02
Re: Greasemonkey script to display team data on FPL league p
Mostly because people won't join a league just for my convenience, as they are:nickchild wrote:Could you elaborate...?Carlos Kickaball wrote:Nick I was wondering if it would be possible if a script could assemble a league of players using their IDs?
It's definitely possible but would probably be better as a standalone page.
Why can you not just create a new league?
Members of Fiso who don't wish to share there team ID with everyone.
Members of Fiso who don't wish to join a mini league for other reasons.
Non members of Fiso who woulden't want to join a league just because I've told them it's a league of people whose teams I'm interested in.
One thing I had wondered, is personally as a Greasemonkey idiot, how do I know Greasemonkey scripts are safe?
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
Carlos Kickaball wrote:Non members of Fiso who woulden't want to join a league just because I've told them it's a league of people whose teams I'm interested in.
http://stackoverflow.com/questions/3163 ... easemonkey" onclick="window.open(this.href);return false;Carlos Kickaball wrote:One thing I had wondered, is personally as a Greasemonkey idiot, how do I know Greasemonkey scripts are safe?
The biggest issue you could have is someone stealing a password, but the Greasemonkey script would have be running on the login page of the site. You can check in your Greasemonkey settings which URLs are including each script.
Mine for example only runs when accessing the league pages: http://fantasy.premierleague.com/my-leagues*" onclick="window.open(this.href);return false;
- MoSe
- Dumbledore
- Posts: 9562
- 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
Hi Nick,
going on making great use of your script(s)
reading in the Overall rank topic here, I thought it'd have been cool to gather the rank of all FISO members who entered the Official Fiso FPL Minileague 2014-15 (league name shows as "the FISO forum")
so I said to myself, Hey, I could use the wonderful nickchild script to easily list all the rankings...
then I realised your table doesn't report GR (Gameweek Rank) and OR (Overall Rank) which are tho available in individual GW History pages.
I know, this is a bit out of the purpose of your table, and the extra two columns would risk to clutter too much the display only to add a statistical curiosity.
So I figure I'll have to forsake for the moment the plan to chart the overall ranking of the 1,051 members of the FISO forum ML
(individually clicking 1k teams is out of question even for a statpervert like me )
going on making great use of your script(s)
reading in the Overall rank topic here, I thought it'd have been cool to gather the rank of all FISO members who entered the Official Fiso FPL Minileague 2014-15 (league name shows as "the FISO forum")
so I said to myself, Hey, I could use the wonderful nickchild script to easily list all the rankings...
then I realised your table doesn't report GR (Gameweek Rank) and OR (Overall Rank) which are tho available in individual GW History pages.
I know, this is a bit out of the purpose of your table, and the extra two columns would risk to clutter too much the display only to add a statistical curiosity.
So I figure I'll have to forsake for the moment the plan to chart the overall ranking of the 1,051 members of the FISO forum ML
(individually clicking 1k teams is out of question even for a statpervert like me )
- 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
Nick, now that the leaders in some leagues, and certainly the overall leaders, are over 1,000 points there is an error occurring in the live "total" field.
Once a person reaches 1,000 points the live "total" field just shows the number "1" from the "1,000", so a person with 999 points will have "999" displayed but the person ahead with 1,000 or more only "1".
I'd hope this is just a minor change to expand the column field size to cope with the extra digit(s).
Once a person reaches 1,000 points the live "total" field just shows the number "1" from the "1,000", so a person with 999 points will have "999" displayed but the person ahead with 1,000 or more only "1".
I'd hope this is just a minor change to expand the column field size to cope with the extra digit(s).
-
- Cheetah
- Posts: 3
- Joined: 20 Dec 2014, 19:41
Re: Greasemonkey script to display team data on FPL league p
Same thing happened to me today after some heavy point gains. It happens because FPL adds a comma when a number is larger than 1000 and the script can't read it properly. Go to line 705 (or around there) and find a line containing:
totalScore = parseInt(rowtds[5].innerHTML, 10);
And just replace this with:
totalScore = rowtds[5].innerHTML; totalScore = parseInt(totalScore.replace(/\,/g,''), 10);
totalScore = parseInt(rowtds[5].innerHTML, 10);
And just replace this with:
totalScore = rowtds[5].innerHTML; totalScore = parseInt(totalScore.replace(/\,/g,''), 10);
- SuperGrover
- Grumpy Old Man
- Posts: 1540
- Joined: 12 Sep 2012, 15:38
- Location: Chicago, USA
- FPL:
Re: Greasemonkey script to display team data on FPL league p
Thank you sir. I didn't feel like troubleshooting the code. Been a long time since I looked at Javascript!
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
Had just spotted this myself and have made the fix this morning. Have used similar code as shown above but am also formatting the nuber to re-add the commas as per FPL's display.
Will be back soon to add the bonus wildcard stats in.
Merry Christmas everyone!
Will be back soon to add the bonus wildcard stats in.
Merry Christmas everyone!
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league p
Interesting idea. I will try to add this in at some point over the festive break...!MoSe wrote:Hi Nick,
going on making great use of your script(s)
reading in the Overall rank topic here, I thought it'd have been cool to gather the rank of all FISO members who entered the Official Fiso FPL Minileague 2014-15 (league name shows as "the FISO forum")
so I said to myself, Hey, I could use the wonderful nickchild script to easily list all the rankings...
then I realised your table doesn't report GR (Gameweek Rank) and OR (Overall Rank) which are tho available in individual GW History pages.
I know, this is a bit out of the purpose of your table, and the extra two columns would risk to clutter too much the display only to add a statistical curiosity.
So I figure I'll have to forsake for the moment the plan to chart the overall ranking of the 1,051 members of the FISO forum ML
(individually clicking 1k teams is out of question even for a statpervert like me )
-
- Treebeard
- Posts: 261
- Joined: 01 Dec 2010, 23:05
Re: Greasemonkey script to display team data on FPL league page
nickchild
This is AWESOME, truely awesome!! This will give me the overview I needed and save me thousands of clicks! Btw, since we're in the middle of a DGW. Is there any update planned that would show the TP (players to play) who are expected to have another match coming?
This is AWESOME, truely awesome!! This will give me the overview I needed and save me thousands of clicks! Btw, since we're in the middle of a DGW. Is there any update planned that would show the TP (players to play) who are expected to have another match coming?
- nickchild
- FISOhead
- Posts: 648
- Joined: 27 Jul 2006, 23:51
- FS Record: 180th Overall FPL and X-League Winner 2008/09
- FPL:
- Contact:
Re: Greasemonkey script to display team data on FPL league page
Have updated the script to reflect DGW players. They will remain in the TP (To Play) column until their 2nd game has started. They should also not move to the DNP (Did Not Play) column unless they have played 0 minutes in both games. There will now also be an indicator in the rollover of the TP column showing if a player has multiple games left in the gameweek.
View Latest: 1 Day View Your posts