Life In 19x19
http://www.lifein19x19.com/

Obtaining user's rank
http://www.lifein19x19.com/viewtopic.php?f=24&t=10859
Page 1 of 2

Author:  Ellyster [ Tue Sep 23, 2014 4:37 pm ]
Post subject:  Obtaining user's rank

Is there any way to get the rank of user knowing their users name? (similarly to their rank graph)

I'm developing a website, I would like to use the KGS rank of the user to tune the contents that they get (show the ones more interesting for their level). But I don't know if obtaining the rank from KGS by code would be easy... right now the only solution that I see is to download their last game and extract it from there... but it seems quite an inefficient method.

Author:  DrStraw [ Tue Sep 23, 2014 5:36 pm ]
Post subject:  Re: Obtaining user's rank

The archive page has there games for the current month and it displays their rank in their last game. Try:

http://www.gokgs.com/gameArchives.jsp?user=ellyster

If there are no games for the current month you can try:

http://www.gokgs.com/gameArchives.jsp?u ... 14&month=8

until you find the last game.

Author:  Mef [ Tue Sep 23, 2014 5:54 pm ]
Post subject:  Re: Obtaining user's rank

The rank graph is probably the closest thing available to what you are looking for. It seems to me though of you are tuning website content, it might be easier / more desirable to have the users simply self report a rank. I suppose this has the drawback of not auto updating though...

Author:  xed_over [ Wed Sep 24, 2014 1:11 pm ]
Post subject:  Re: Obtaining user's rank

DrStraw wrote:
The archive page has there games for the current month and it displays their rank in their last game. Try:

http://www.gokgs.com/gameArchives.jsp?user=ellyster

If there are no games for the current month you can try:

http://www.gokgs.com/gameArchives.jsp?u ... 14&month=8

until you find the last game.


or just their rank graph

http://www.gokgs.com/graphPage.jsp?user=ellyster

Author:  DrStraw [ Wed Sep 24, 2014 6:21 pm ]
Post subject:  Re: Obtaining user's rank

xed_over wrote:


Is it possible to read information from the rank graph with a program?

Author:  Uberdude [ Thu Sep 25, 2014 12:12 am ]
Post subject:  Re: Obtaining user's rank

I'm sure it's possible with OCR (Optical Character Recognition) but certainly more convoluted and difficult. Today's xkcd is apt. ;-)

Author:  Mef [ Thu Sep 25, 2014 4:47 am ]
Post subject:  Re: Obtaining user's rank

Uberdude wrote:
I'm sure it's possible with OCR (Optical Character Recognition) but certainly more convoluted and difficult. Today's xkcd is apt. ;-)



Actually, for something like the kgs rank graph I would think it shouldn't be a terribly convoluted process. Well defined shapes and colors, I vaguely recall doing image processing stuff like this in an introductory Matlab course.

Author:  Uberdude [ Thu Sep 25, 2014 5:08 am ]
Post subject:  Re: Obtaining user's rank

I didn't mean it was 5 years and a research team convuluted, but it's certainly more complicated than a regex or a few ifs and strstrs.

Author:  ez4u [ Thu Sep 25, 2014 5:12 am ]
Post subject:  Re: Obtaining user's rank

What kind of site are you planning that will be visited mainly by KGS players where you would not request/trust their self-reported rank but will request, receive, and then trust their self-reported username?
:scratch:

Author:  Mef [ Thu Sep 25, 2014 6:51 am ]
Post subject:  Re: Obtaining user's rank

Uberdude wrote:
I didn't mean it was 5 years and a research team convuluted, but it's certainly more complicated than a regex or a few ifs and strstrs.


Actually, it might not be terribly more complicated than that....if you convert the png to a bitmap all you need to do is find the green pixels to get the coordinates of a raw graph. A similar type search could be used to figure out the horizontal graph divisions. This would more or less give you the fractional component of a rank at any time. The numbers for the ranks themselves can be found from the archive game list.

Author:  cobrahc [ Thu Sep 25, 2014 2:32 pm ]
Post subject:  Re: Obtaining user's rank

Hi There,

I just had some free time and I did this.

https://bitbucket.org/wendelbsilva/kgs-data/overview

Its almost like Mef suggested. Right now its only getting the rank from the graph (and plotting it again).
I didnt had a lot of time free, so the code is 'ugly' and 'slow'. If I have some free time later I will fix those issues and add more stuff. My next step would be to identify the date range.

Language: Python
Libraries used:
> PyPandas: To read tables from HTML
> OpenCV: To play with the image and if needed later, do any image processing needed
> PyLab: To plot the data.

Author:  Mef [ Thu Sep 25, 2014 11:56 pm ]
Post subject:  Re: Obtaining user's rank

cobrahc wrote:
Hi There,

I just had some free time and I did this.

https://bitbucket.org/wendelbsilva/kgs-data/overview

Its almost like Mef suggested. Right now its only getting the rank from the graph (and plotting it again).
I didnt had a lot of time free, so the code is 'ugly' and 'slow'. If I have some free time later I will fix those issues and add more stuff. My next step would be to identify the date range.

Language: Python
Libraries used:
> PyPandas: To read tables from HTML
> OpenCV: To play with the image and if needed later, do any image processing needed
> PyLab: To plot the data.



Nice!

To come back to Uberdude's comic, I think the go equivalent would be something like this:

"Let's have the app where users submit a picture of their go board, and convert the position to sgf..."

(Non-trivial, but not impossible)

"...then respond back to them with the best move to play in that position..."

(Decades of CS research)

Author:  Ellyster [ Fri Sep 26, 2014 10:08 am ]
Post subject:  Re: Obtaining user's rank

ez4u wrote:
What kind of site are you planning that will be visited mainly by KGS players where you would not request/trust their self-reported rank but will request, receive, and then trust their self-reported username? :scratch:


Is not about the trust in the user, is about having the rank always up-to-date without being a pain in the ass to the user, that way the content can change smoothly with the learning pace.

cobrahc wrote:
https://bitbucket.org/wendelbsilva/kgs-data/overview

In the worst case I was planning in doing the same, but checking with your code, it seems that parsing the HTML page is quite slow and resource consuming, so I will probably not add that functionality at the end.

And is not only being too slow for being used in a webpage, also I really don't like the idea of being constantly crawling the KGS archives, it may affect the performance of the server :(.

BTW, your code fails if the user has no recent (this month) played game (it would need to search and parse backwards each month until it finds a game).



I wonder if wms will implement that functionality at some point (since is really simple), lots of places would benefit from that... for example L19 or the ASR webpage (they have an open issue about it in GitHub).

Author:  cobrahc [ Fri Sep 26, 2014 10:32 am ]
Post subject:  Re: Obtaining user's rank

You are correct. My code is slow and doesnt work in a lot of cases. Not only that, it may burden the server.
What I want for the near future is to get a list of players(anonymously) with their progress so I can do some analytics. I need to think how to do that in slowly (to not burden the server) and in batch mode.

Anyway, Im only playing with this code during my breaks, so its going to take some time before I have it in the way I would like to.

Would be nice if KGS and/or others servers had some kind of API where we could get historical data (maybe) or only even the rank of a given player.

Author:  Uberdude [ Fri Sep 26, 2014 11:19 am ]
Post subject:  Re: Obtaining user's rank

Ellyster wrote:
I wonder if wms will implement that functionality at some point (since is really simple), lots of places would benefit from that...


:lol: :lol: The stone click sound is also really simple, far bigger negative impact, and hasn't been fixed for years. So I'll bet on a no.

cobrahc wrote:

Would be nice if KGS and/or others servers had some kind of API where we could get historical data (maybe) or only even the rank of a given player.


http://online-go.com/api/ and http://docs.ogs.apiary.io/

Author:  Mef [ Sat Sep 27, 2014 1:39 am ]
Post subject:  Re: Obtaining user's rank

Ellyster wrote:

And is not only being too slow for being used in a webpage, also I really don't like the idea of being constantly crawling the KGS archives, it may affect the performance of the server :(.

As far as I know, the server that runs kgs and the server that hosts the web archive are separate entities. That said, I do know that there is a delay required if you're going to crawl the website, otherwise it will lock you out after a certain number of archive page requests in too short a timespan. This is to presumably prevent scripts from affecting the performance of the website server.

Author:  ez4u [ Sat Sep 27, 2014 6:27 am ]
Post subject:  Re: Obtaining user's rank

Ellyster wrote:
ez4u wrote:
What kind of site are you planning that will be visited mainly by KGS players where you would not request/trust their self-reported rank but will request, receive, and then trust their self-reported username? :scratch:


Is not about the trust in the user, is about having the rank always up-to-date without being a pain in the ass to the user, that way the content can change smoothly with the learning pace.
...

To me you seem to have your priorities backwards. You have (are building) a website with content that your users will enter and progress through ("learning"). Yet instead of basing the offered material on their performance on your website, you seem to want to alter what you offer based on their rating on KGS, an unrelated site. If you did this to me, I would be upset! If I choose to come to your site and work through the items available, why would I want to suddenly skip to another level just because I beat tartrate or some other KGS clown? I don't get it. :batman:

Author:  Ellyster [ Sat Sep 27, 2014 12:08 pm ]
Post subject:  Re: Obtaining user's rank

ez4u wrote:
Ellyster wrote:
ez4u wrote:
What kind of site are you planning that will be visited mainly by KGS players where you would not request/trust their self-reported rank but will request, receive, and then trust their self-reported username? :scratch:


Is not about the trust in the user, is about having the rank always up-to-date without being a pain in the ass to the user, that way the content can change smoothly with the learning pace.
...

To me you seem to have your priorities backwards. You have (are building) a website with content that your users will enter and progress through ("learning"). Yet instead of basing the offered material on their performance on your website, you seem to want to alter what you offer based on their rating on KGS, an unrelated site. If you did this to me, I would be upset! If I choose to come to your site and work through the items available, why would I want to suddenly skip to another level just because I beat tartrate or some other KGS clown? I don't get it. :batman:


The users will not enter any content, absolutely all the contents are provided by (mostly Japanese) professional players. The user's KGS rank will be used to position better (and make suggestions about) the material that we judge more adequate for their specific level. Any user can access to all the content without level restrictions.

From my point of view the best way of truly measuring learning progress in Go is through played games, where you can apply the techniques that you learn... and KGS rank is as good as any other, that's where it comes into place (also since part of the teaching will probably be offer there).

Author:  anazawa [ Wed Oct 01, 2014 9:37 am ]
Post subject:  Re: Obtaining user's rank

You can try unofficial JSON API for KGS Go Server, MetaKGS (http://metakgs.org/docs).
I believe you can GET /api/archives/:user which contains the user's latest rank.

Note: MetaKGS is in beta state, and so the APIs may change without notice.

Author:  Ellyster [ Wed Oct 01, 2014 3:13 pm ]
Post subject:  Re: Obtaining user's rank

anazawa wrote:
You can try unofficial JSON API for KGS Go Server, MetaKGS (http://metakgs.org/docs).
I believe you can GET /api/archives/:user which contains the user's latest rank.

Note: MetaKGS is in beta state, and so the APIs may change without notice.


Wow! It's a great project.

Sadly GET /api/archives/:user do not include the user's latest rank (will be an awesome feature improvement, maybe even I try to do a pull request when I get some free time ;-) ).


Right now, I will need to do GET /api/archives/:user, then GET prev, and then go to content -> games -> first game -> white (and black) -> check players' names and ranks. Is a little bit long, but still the better way to do it so far.

Page 1 of 2 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/