Any plans on making a publicly available API?

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:points: :-D :eyeroll: :neutral: :nmr: :razz: :raging: :-) ;) :( :sick: :o :? 8-) :x :shock: :lol: :cry: :evil: :?: :smirk: :!:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is OFF
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Expand view Topic review: Any plans on making a publicly available API?

Re: Any plans on making a publicly available API?

by c5m » Tue Sep 13, 2022 6:35 pm

Sounds good! That makes sense. It won’t be a bot (in fact it will be read-only).

Re: Any plans on making a publicly available API?

by kestasjk » Tue Sep 13, 2022 5:41 pm

If you're just doing regular user activities and want to make client apps etc feel free to use cookie authentication, but please don't do any actual bot order submission etc as we want to know which users are bots and which aren't.

Sound like an interesting project, keep us posted.

Re: Any plans on making a publicly available API?

by c5m » Tue Sep 13, 2022 3:46 pm

In https://github.com/kestasjk/webDiplomac ... master/api, it says:
To get an API key, please contact web site administrator.
Does anyone know how I can get a long-living key? Or should I just authenticate with username and password and use the cookie?

I'm hoping to connect an e-ink display to webdiplomacy so I can poll every ~30 mins or so and see new messages in games I'm playing.

Re: Any plans on making a publicly available API?

by kestasjk » Sat Jun 04, 2022 3:29 am

A_Tin_Can wrote:
Sat May 21, 2022 5:30 pm
Side node: what are you using to do web scraping? You shouldn't be hitting performance issues because of scraping. The time to make the http call should be by far the biggest cost, and for a bot that fires every few minutes, an API and scraper should be similarly performant. Of course, not scraping is better - it'll be cleaner, a nicer development experience, and more robust if the site changes etc. But if you're hitting performance issues, I think something might be misconfigured or maybe there are mistakes in the implementation.
To be honest one of the things I'd really like to do is gut out all the HTML from webDip and replace it all with Bootstrap or something like that. I don't think the site can get a modern HTML design incrementally it'd need to be redone, so I wouldn't recommend scraping for anything you're not prepared to have to abruptly redo

It's probably 4th/5th down the list of big projects, so it won't happen for a long time, but still

Re: Any plans on making a publicly available API?

by kestasjk » Sat Jun 04, 2022 3:22 am

KraftaN wrote:
Wed May 18, 2022 9:21 am
I recently got into Diplomacy and it has been a blast, as my excitement for the game grew, the more the urge to create some rudimentary commands to my discord bot grew. I searched for an API but could not find one so I decided to just web scrape which works but is quite annoying and brings overall performance down. But making commands that revolve around notifying everyone when a new turn has begun is noticeably harder to create without the help of an API, so as the title imply is there any future plans to make a webDiplomacy api?
Check out https://github.com/kestasjk/webDiplomacy/api.php , https://github.com/kestasjk/webDiplomacy/ajax.php , and https://github.com/kestasjk/webDiplomacy/board.php (with a GET arg ?mapType=json )

Collectively I these interfaces let you send and receive messages, cast votes, submit orders, get the board state, get your orders to be submitted, submit orders, mute/unmute, get the order and board history, and get the game state, all via JSON.
You'd have to authenticate by POSTing a username and password and reading the cookie that's returned, I don't think there is game search, game create, game join, or game leave yet, but those wouldn't be much effort to add.
Besides that it's pretty complete.

Re: Any plans on making a publicly available API?

by A_Tin_Can » Sat May 21, 2022 5:30 pm

There isn't a public API.

What do you want to do? Just get the turn information for a specific game? I know this isn't the answer you're looking for, but webdip is open source - if you wanted to make a PR, you could make a copy of board.php and strip it back to just render the information you're looking for as JSON. https://github.com/kestasjk/webDiplomac ... /board.php

Side node: what are you using to do web scraping? You shouldn't be hitting performance issues because of scraping. The time to make the http call should be by far the biggest cost, and for a bot that fires every few minutes, an API and scraper should be similarly performant. Of course, not scraping is better - it'll be cleaner, a nicer development experience, and more robust if the site changes etc. But if you're hitting performance issues, I think something might be misconfigured or maybe there are mistakes in the implementation.

Re: Any plans on making a publicly available API?

by KraftaN » Fri May 20, 2022 11:55 am

alviac2186 wrote:
Fri May 20, 2022 6:19 am
Aparently one already exists never mind.
viewtopic.php?f=16&t=2771
I saw it. But the point was I myself wanted to make something myself (which I have done but I would love to make it more efficient)

Re: Any plans on making a publicly available API?

by KraftaN » Fri May 20, 2022 11:53 am

alviac2186 wrote:
Thu May 19, 2022 11:45 pm
I would be happy to make a Discord bot for you if you want... all it would have to do is check the map every 5 minutes and see if there have been any changes.
I've already done that, but thanks for asking!

Re: Any plans on making a publicly available API?

by alviac2186 » Fri May 20, 2022 6:19 am

Aparently one already exists never mind.
viewtopic.php?f=16&t=2771

Re: Any plans on making a publicly available API?

by alviac2186 » Thu May 19, 2022 11:45 pm

I would be happy to make a Discord bot for you if you want... all it would have to do is check the map every 5 minutes and see if there have been any changes.

Re: Any plans on making a publicly available API?

by wulfheart » Thu May 19, 2022 7:06 pm

I would love to see an adjudication API. However, I don't think that this will be possible.

Re: Any plans on making a publicly available API?

by Wusti » Thu May 19, 2022 9:13 am

Yes its called log in and check :P

Any plans on making a publicly available API?

by KraftaN » Wed May 18, 2022 9:21 am

I recently got into Diplomacy and it has been a blast, as my excitement for the game grew, the more the urge to create some rudimentary commands to my discord bot grew. I searched for an API but could not find one so I decided to just web scrape which works but is quite annoying and brings overall performance down. But making commands that revolve around notifying everyone when a new turn has begun is noticeably harder to create without the help of an API, so as the title imply is there any future plans to make a webDiplomacy api?

Top