Conquer Club

Conquer Club API

Discuss developing tools and get details on Conquer Club's API.

Moderator: Tech Team

Forum rules
Please read the Community Guidelines before posting.

Re: Conquer Club API

Postby chipv on Wed Jan 13, 2010 8:03 am

mwhagedorn wrote:Did something change recently in the gamelist api? I am getting wierd values for the player ids


Depends on what you mean by recently, yes there was a big change recently.

Which page is showing up with weird values?
User avatar
Lieutenant chipv
 
Posts: 2751
Joined: Mon Apr 28, 2008 5:30 pm

Re: Conquer Club API

Postby mwhagedorn on Wed Jan 13, 2010 2:42 pm

Great thanks for the rapid response.

The following query (now) produces garbage values for both usernames, and userids. Furthermore it doesnt seem to be returning the waiting games, rather it seems to be returning finished games.

http://www.conquerclub.com/api.php?mode=gamelist&un=<USERNAME>&gs=W
Cadet mwhagedorn
 
Posts: 5
Joined: Fri Jan 09, 2009 4:39 pm

Re: Conquer Club API

Postby mwhagedorn on Wed Jan 13, 2010 2:45 pm

curl http://www.conquerclub.com/api.php?mode ... gn=6222685

also returns garbage, its not the details of that game
Cadet mwhagedorn
 
Posts: 5
Joined: Fri Jan 09, 2009 4:39 pm

Re: Conquer Club API

Postby chipv on Wed Jan 13, 2010 3:58 pm

I can't see what is wrong with these, they appear to correspond with the game settings.

Which elements are garbage?

One change in the API is that you need &events=Y for events now.
User avatar
Lieutenant chipv
 
Posts: 2751
Joined: Mon Apr 28, 2008 5:30 pm

Re: Conquer Club API

Postby Dako on Wed Jan 13, 2010 4:09 pm

Both requests work fine for me. Maybe check you raw response of the curl?

To check if they work - just type them into browser and see how the responding xml is formed.
Image
User avatar
Colonel Dako
 
Posts: 3987
Joined: Sun Aug 26, 2007 9:07 am
Location: St. Petersburg, Russia

Re: Conquer Club API

Postby Foxglove on Wed Jan 13, 2010 4:39 pm

I would like to make one more request (I know, I know..I'm never satisfied):

Can we get another addition to the game object to return either the length of the game chat or the number of lines it contains?

I wrote a new script to display a menu item containing a count of the number of games with new chat so that it's easy to identify when to go check out comments in games, but of course, this requires constant ajax calls to all of a user's active games.

Also - can we please get some kind of indication as to whether or not our requests are being considered? A yes, no, maybe, and perhaps even a time line would be super useful. I requested API extensions to include the user data back at the beginning of October, and no one posted in this thread until the end of December announcing the new API updates. It would have been nice to know whether or not my idea was being considered, whether it was already on the table for development, or what.
Brigadier Foxglove
 
Posts: 1308
Joined: Sun Dec 16, 2007 1:05 pm

Re: Conquer Club API

Postby chipv on Wed Jan 13, 2010 5:10 pm

Foxglove wrote:I would like to make one more request (I know, I know..I'm never satisfied):

Can we get another addition to the game object to return either the length of the game chat or the number of lines it contains?

I wrote a new script to display a menu item containing a count of the number of games with new chat so that it's easy to identify when to go check out comments in games, but of course, this requires constant ajax calls to all of a user's active games.

Also - can we please get some kind of indication as to whether or not our requests are being considered? A yes, no, maybe, and perhaps even a time line would be super useful. I requested API extensions to include the user data back at the beginning of October, and no one posted in this thread until the end of December announcing the new API updates. It would have been nice to know whether or not my idea was being considered, whether it was already on the table for development, or what.


Your request for single games was pushed forward and made it into the very next API release.
The user data suggestion is unlikely - how long do you think the URL is going to be if you request 50 user names. 100. 500. 1000?

An alternative might be to ask for blocks of users with a smaller parameter set. e.g. Users from A-C something like that anyway.

Length of game chat is possible, I will let you know.

If you are expecting everyone's requests to get a progress report in the forums,
then you may like to go to Suggs and Buggs to see how long some
people there have to wait. You are lucky to have got your first request met immediately
(if I hadn't pushed it through it wouldn't have happened, simple).
Considering you have me on MSN (the other script writers also) it may have been more gracious to have chatted about it.

Anyway I will endeavour to post updates on all of your individual requests if possible, but I also have a busy real life so perhaps exercise a modicum of patience in future like everyone else has done.
User avatar
Lieutenant chipv
 
Posts: 2751
Joined: Mon Apr 28, 2008 5:30 pm

Re: Conquer Club API

Postby Foxglove on Wed Jan 13, 2010 6:07 pm

chipv wrote:
Foxglove wrote:I would like to make one more request (I know, I know..I'm never satisfied):

Can we get another addition to the game object to return either the length of the game chat or the number of lines it contains?

I wrote a new script to display a menu item containing a count of the number of games with new chat so that it's easy to identify when to go check out comments in games, but of course, this requires constant ajax calls to all of a user's active games.

Also - can we please get some kind of indication as to whether or not our requests are being considered? A yes, no, maybe, and perhaps even a time line would be super useful. I requested API extensions to include the user data back at the beginning of October, and no one posted in this thread until the end of December announcing the new API updates. It would have been nice to know whether or not my idea was being considered, whether it was already on the table for development, or what.


Your request for single games was pushed forward and made it into the very next API release.


And I appreciated it - I posted right away and said so.

chipv wrote:The user data suggestion is unlikely - how long do you think the URL is going to be if you request 50 user names. 100. 500. 1000?

An alternative might be to ask for blocks of users with a smaller parameter set. e.g. Users from A-C something like that anyway.


Yes, I suppose I didn't think that one through very carefully. I wanted it for my clan script, so I was anticipating using it for 20ish-50? users, but you're right, that would make a very long URL.

chipv wrote:Length of game chat is possible, I will let you know.


Thank you.

chipv wrote:If you are expecting everyone's requests to get a progress report in the forums, then you may like to go to Suggs and Buggs to see how long some people there have to wait.


I'm not "expecting" anything. I basically asked for an indication that ideas have been read - that's it. Maybe that is an excessively onerous request, maybe I didn't make my request in a friendly enough fashion, but it's something that I would find beneficial, so I asked.

chipv wrote:You are lucky to have got your first request met immediately (if I hadn't pushed it through it wouldn't have happened, simple).


I did thank you at the time when we talked about it, and thank you again for making it happen. Maybe I didn't show enough gratitude, then or now? What else would you like from me?

chipv wrote:Considering you have me on MSN (the other script writers also) it may have been more gracious to have chatted about it.


Aside from a few people, I don't even know how many script writers there are, and of those who do write scripts, I don't know what they are interested in or what their current projects might be. I thought maybe other people might be interested in the same features I'm asking for, and I thought that maybe other people might also like acknowledgment of their ideas/requests.

chipv wrote:Anyway I will endeavour to post updates on all of your individual requests if possible, but I also have a busy real life so perhaps exercise a modicum of patience in future like everyone else has done.


I definitely understand that you have a busy life outside of CC. I don't quite understand at which point in this thread I displayed a complete dearth of patience (a modicum is such a small amount, and you say I had none at all?), but I will endeavor to exercise restraint, and cease my constant requests and ungrateful demands.
Brigadier Foxglove
 
Posts: 1308
Joined: Sun Dec 16, 2007 1:05 pm

Re: Conquer Club API

Postby ronsizzle on Wed Jan 13, 2010 6:14 pm

i couldnt tell? was that a fitz post above this one?
User avatar
Sergeant 1st Class ronsizzle
 
Posts: 2553
Joined: Mon Apr 09, 2007 8:30 pm

Re: Conquer Club API

Postby Dako on Wed Jan 13, 2010 6:39 pm

Foxy and chip - please stay on topic. All your issues about honor and patience may be discussed in privacy over PM or MSN. We are not that interested in your "quarrel" as you might (or might not) think.

Thanks, Dako (just want this topic to be clear enough for others to read).
Image
User avatar
Colonel Dako
 
Posts: 3987
Joined: Sun Aug 26, 2007 9:07 am
Location: St. Petersburg, Russia

Re: Conquer Club API

Postby Dako on Mon Jan 18, 2010 9:12 am

One more API bug:

Following link is not working
http://www.conquerclub.com/api.php?mode ... s%20Empire

Reason - I guess it is the ' sign in the map name that messes things up (cause it should be stripped from input). Escaping the character doesn't give anything.
Image
User avatar
Colonel Dako
 
Posts: 3987
Joined: Sun Aug 26, 2007 9:07 am
Location: St. Petersburg, Russia

Re: Conquer Club API

Postby Dako on Thu Jan 21, 2010 4:21 am

Another bug (or what?).

http://www.conquerclub.com/api.php?mode ... gn=6272744

Should list 4 teams with 2 players each, 6 of slots empty. But right now it returns only 2 players for the game. No way to find how many players there should be.
Image
User avatar
Colonel Dako
 
Posts: 3987
Joined: Sun Aug 26, 2007 9:07 am
Location: St. Petersburg, Russia

Re: Conquer Club API

Postby chipv on Thu Jan 21, 2010 4:49 pm

Thanks for the excellent bug reports, Dako, keep them coming!

Alexander's Empire looks like a bug and I agree with waiting games showing empty slots.
User avatar
Lieutenant chipv
 
Posts: 2751
Joined: Mon Apr 28, 2008 5:30 pm

Re: Conquer Club API

Postby chipv on Thu Jan 21, 2010 5:24 pm

Dako wrote:One more API bug:

Following link is not working
http://www.conquerclub.com/api.php?mode ... s%20Empire

Reason - I guess it is the ' sign in the map name that messes things up (cause it should be stripped from input). Escaping the character doesn't give anything.


Fixed (thanks for quick response, lack)
User avatar
Lieutenant chipv
 
Posts: 2751
Joined: Mon Apr 28, 2008 5:30 pm

Re: Conquer Club API

Postby Dako on Thu Jan 21, 2010 5:37 pm

So for now, these are the bugs/change requests I've found top priority (for my scripts at least, but I know Foxy will be glad for #1 and #4 to be fixed):

  1. [CR] - Player API doesn't return if the member is premium or freemium
  2. [CR] - Gamelist API doesn't indicate blocked players in freestyle games
  3. [BUG] - Gamelist API still have "Time remaining" clock running down after the game was finished
  4. [BUG] - Gamelist API never shows empty player slots for a game (it just skips them)

Maybe I will find something else in the next few days, but for now my script runs smoothly with the new API. Kudos to lack.
Image
User avatar
Colonel Dako
 
Posts: 3987
Joined: Sun Aug 26, 2007 9:07 am
Location: St. Petersburg, Russia

Re: Conquer Club API

Postby barrycarter on Sun Aug 08, 2010 9:32 am

To confirm, the API won't tell you who has how many troops on which territories for a given game, correct? Even with the gn query, the info you get is limited, yes?
Sergeant 1st Class barrycarter
 
Posts: 51
Joined: Sat Jul 31, 2010 10:42 am

Re: Conquer Club API

Postby sherkaner on Sun Aug 08, 2010 9:38 am

Correct, it's only general info.
Colonel sherkaner
 
Posts: 1595
Joined: Thu May 03, 2007 3:21 am
Location: Zwolle

Re: Conquer Club API

Postby barrycarter on Sun Aug 08, 2010 9:50 am

And using a program to auto-login myself and scrape the info from the JSON data on the game page is considered a bad thing, yes?
Sergeant 1st Class barrycarter
 
Posts: 51
Joined: Sat Jul 31, 2010 10:42 am

Re: Conquer Club API

Postby sherkaner on Sun Aug 08, 2010 10:04 am

Depends, not in all cases. For instance I think the Game Link-plugin actually uses the fact that you're already logged in to retrieve the game pages and use the info from those pages, which looks like what you're planning to do. But that's quite heavy, so it's not advised.
Colonel sherkaner
 
Posts: 1595
Joined: Thu May 03, 2007 3:21 am
Location: Zwolle

Re: Conquer Club API

Postby Dako on Sun Aug 08, 2010 10:19 am

It's not bad - it is slow and hard to code/support. Any change to game layout will give you a bunch of work to up[date the tool. While abstract API just gives the data you need.
Image
User avatar
Colonel Dako
 
Posts: 3987
Joined: Sun Aug 26, 2007 9:07 am
Location: St. Petersburg, Russia

Re: Conquer Club API

Postby barrycarter on Sun Aug 08, 2010 11:25 am

Thanks. My thought was to create a site where people enter a CC game number, and get various stats, who has best probability of winning, warnings (like: "if red grabs foo, he'll get a bonus"), etc.

Having the maps in XML format is really useful for general strategies, but I was thinking of a game-specific real-time strategy.
Sergeant 1st Class barrycarter
 
Posts: 51
Joined: Sat Jul 31, 2010 10:42 am

Re: Conquer Club API

Postby Foxglove on Sun Aug 08, 2010 2:37 pm

sherkaner wrote:Depends, not in all cases. For instance I think the Game Link-plugin actually uses the fact that you're already logged in to retrieve the game pages and use the info from those pages, which looks like what you're planning to do. But that's quite heavy, so it's not advised.


Once the API provides the required information, there will be no need to do it the "heavy" way anymore. But for now... that's the only way to allow the script to work properly!
Brigadier Foxglove
 
Posts: 1308
Joined: Sun Dec 16, 2007 1:05 pm

Re: Conquer Club API

Postby sherkaner on Sun Aug 08, 2010 2:45 pm

Foxglove wrote:
sherkaner wrote:Depends, not in all cases. For instance I think the Game Link-plugin actually uses the fact that you're already logged in to retrieve the game pages and use the info from those pages, which looks like what you're planning to do. But that's quite heavy, so it's not advised.


Once the API provides the required information, there will be no need to do it the "heavy" way anymore. But for now... that's the only way to allow the script to work properly!

:) Yeah, obviously you have a valid point. And I use and love the script btw (except when I get on a forum page with 100+ games I'm not interested in).
Colonel sherkaner
 
Posts: 1595
Joined: Thu May 03, 2007 3:21 am
Location: Zwolle

Re: Conquer Club API

Postby barrycarter on Tue Aug 24, 2010 3:02 pm

Can you get game start time from the API? The events field doesn't include "game initialized" and I can't see it anywhere else.
Sergeant 1st Class barrycarter
 
Posts: 51
Joined: Sat Jul 31, 2010 10:42 am

Re: Conquer Club API

Postby barrycarter on Tue Aug 24, 2010 3:04 pm

BTW, I'm working on a greasemonkey script:

http://github.com/barrycarter/bcapps/bl ... ub-game.js

that scrapes current data from a game page and posts it to my website, where it gets logged but nothing else happens.

If anyone's interested in helping out, please ping me, thanks.
Sergeant 1st Class barrycarter
 
Posts: 51
Joined: Sat Jul 31, 2010 10:42 am

Next

Return to Tools Development

Who is online

Users browsing this forum: No registered users