New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add user's latest rank to GET /api/archives/:user #1
Comments
Thanks for your request. A) Add HTTP method to MetaKGS.org (your idea). For example, we can add "GET /api/users/:user" {
"name": "foo",
"rank": "1d",
"games": 123,
"archives_url": "http://metakgs.org/api/archives/foo",
...
} B) Write a MetaKGS client using your favorite language and then implement the object method #get_latest_rank_by_name (my recommendation). You have already understood C) If you are a Perl user, you can subclass WWW::GoKGS::Scraper::GameArchives to add the above method. I'm not sure about why you prefer A to B. |
I think A is far better in this case. Of course, I can just do B for my project in the language that I'm using (Ruby on Rails), but since it is a so common query I think it makes more sense to provide it in the MetaKGS API... rather than making everyone implement it in their own projects. An cleaner alternative to A, if you want to preserve the KGS archive structure (a good design choice) might be to implement it under |
Though In addition, MetaKGS is busy parsing HTML. I believe you can imagine how boring to maintain Instead, I'll write a Ruby client for MetaKGS for fun, while I'm a complete Ruby beginner :P Update: replace "followed" with "preceded" |
What about using The other queries will be:
And that way, in
|
I agree the APIs should be easy to extend for the long run.
Obviously "/games" is duplicated! I may be misunderstanding, though. By the way, there are 3 layers in my mind:
Layer 1 & 2, low level layers, are provided by MetaKGS. Yes, it's very unusual webapp structure Currently, I'm working on Ruby client for fun, https://github.com/anazawa/metakgs.rb |
This issue looks inactive. Close temporarily. Feel free to reopen anytime :) |
@Ellyster I added #get_latest_rank_by_name to metakgs.rb 0.0.4. You can use the method as follows: require 'metakgs'
rank = MetaKGS.get_latest_rank_by_name 'UserName' |
So this endpoint ended up not done? It's a shame, I really thought this is super useful. |
I think so, too. Thanks for your comment :) |
It will be great if GET /api/archives/:user include more information about the KGS user, for example their current rank.
Instead of needing to do GET /api/archives/:user, then GET prev, and then go to content -> games -> first game -> white (and black) and finally check players' names and ranks, for an action so common as querying for an user latest rank in KGS.
http://www.lifein19x19.com/forum/viewtopic.php?p=173827#p173827
The text was updated successfully, but these errors were encountered: