It is currently Fri Mar 29, 2024 2:58 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
Offline
 Post subject: Obtaining user's rank
Post #1 Posted: Tue Sep 23, 2014 4:37 pm 
Dies in gote

Posts: 62
Location: Granada, Spain | Osaka, Japan | Turku, Finland | Tokyo, Japan
Liked others: 50
Was liked: 22
Rank: KGS 3 kyu
KGS: Ellyster
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #2 Posted: Tue Sep 23, 2014 5:36 pm 
Oza

Posts: 2180
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Liked others: 237
Was liked: 662
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
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.

_________________
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #3 Posted: Tue Sep 23, 2014 5:54 pm 
Lives in sente

Posts: 852
Location: Central Coast
Liked others: 201
Was liked: 333
Rank: KGS [-]
GD Posts: 428
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...

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #4 Posted: Wed Sep 24, 2014 1:11 pm 
Oza

Posts: 2264
Liked others: 1180
Was liked: 552
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

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #5 Posted: Wed Sep 24, 2014 6:21 pm 
Oza

Posts: 2180
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Liked others: 237
Was liked: 662
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
xed_over wrote:


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

_________________
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #6 Posted: Thu Sep 25, 2014 12:12 am 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
I'm sure it's possible with OCR (Optical Character Recognition) but certainly more convoluted and difficult. Today's xkcd is apt. ;-)

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #7 Posted: Thu Sep 25, 2014 4:47 am 
Lives in sente

Posts: 852
Location: Central Coast
Liked others: 201
Was liked: 333
Rank: KGS [-]
GD Posts: 428
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #8 Posted: Thu Sep 25, 2014 5:08 am 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #9 Posted: Thu Sep 25, 2014 5:12 am 
Oza
User avatar

Posts: 2401
Location: Tokyo, Japan
Liked others: 2338
Was liked: 1332
Rank: Jp 6 dan
KGS: ez4u
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:

_________________
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #10 Posted: Thu Sep 25, 2014 6:51 am 
Lives in sente

Posts: 852
Location: Central Coast
Liked others: 201
Was liked: 333
Rank: KGS [-]
GD Posts: 428
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #11 Posted: Thu Sep 25, 2014 2:32 pm 
Dies in gote
User avatar

Posts: 51
Liked others: 27
Was liked: 2
Rank: IGS 9k
Universal go server handle: cobrahc
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.


This post by cobrahc was liked by: Mef
Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #12 Posted: Thu Sep 25, 2014 11:56 pm 
Lives in sente

Posts: 852
Location: Central Coast
Liked others: 201
Was liked: 333
Rank: KGS [-]
GD Posts: 428
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)

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #13 Posted: Fri Sep 26, 2014 10:08 am 
Dies in gote

Posts: 62
Location: Granada, Spain | Osaka, Japan | Turku, Finland | Tokyo, Japan
Liked others: 50
Was liked: 22
Rank: KGS 3 kyu
KGS: Ellyster
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).

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #14 Posted: Fri Sep 26, 2014 10:32 am 
Dies in gote
User avatar

Posts: 51
Liked others: 27
Was liked: 2
Rank: IGS 9k
Universal go server handle: cobrahc
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #15 Posted: Fri Sep 26, 2014 11:19 am 
Judan

Posts: 6725
Location: Cambridge, UK
Liked others: 436
Was liked: 3719
Rank: UK 4 dan
KGS: Uberdude 4d
OGS: Uberdude 7d
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/


This post by Uberdude was liked by: Bonobo
Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #16 Posted: Sat Sep 27, 2014 1:39 am 
Lives in sente

Posts: 852
Location: Central Coast
Liked others: 201
Was liked: 333
Rank: KGS [-]
GD Posts: 428
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #17 Posted: Sat Sep 27, 2014 6:27 am 
Oza
User avatar

Posts: 2401
Location: Tokyo, Japan
Liked others: 2338
Was liked: 1332
Rank: Jp 6 dan
KGS: ez4u
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:

_________________
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #18 Posted: Sat Sep 27, 2014 12:08 pm 
Dies in gote

Posts: 62
Location: Granada, Spain | Osaka, Japan | Turku, Finland | Tokyo, Japan
Liked others: 50
Was liked: 22
Rank: KGS 3 kyu
KGS: Ellyster
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).

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #19 Posted: Wed Oct 01, 2014 9:37 am 
Dies in gote
User avatar

Posts: 27
Liked others: 6
Was liked: 7
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.

Top
 Profile  
 
Offline
 Post subject: Re: Obtaining user's rank
Post #20 Posted: Wed Oct 01, 2014 3:13 pm 
Dies in gote

Posts: 62
Location: Granada, Spain | Osaka, Japan | Turku, Finland | Tokyo, Japan
Liked others: 50
Was liked: 22
Rank: KGS 3 kyu
KGS: Ellyster
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.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group