A community I am coming from is playing with the idea of migrating to SRC, as we are unsatisfied with our current site. I've taken the liberty of scraping the site for the json data for all current runs. The issue here is that it would appear I need to be a player in the run to submit a run. I was told by a mod (i believe) who works on the SRC version of our runs. He says that moderators can submit runs that they are not a part of. After reading the API documentation I was met with an authentication step, which appears to be on per-user basis.
If I get mod credentials for authentication can I mass submit our runs from our old site to the new one? It is the main thing holding the community back from switching.
Links to the docs: https://github.com/speedruncomorg/api/blob/master/authentication.md
Hello and thanks for considering a migration to SRC! I can provide some clarity here:
- You should be able to accomplish your goal using the API (specifically the POST /v1/runs endpoint)
- You do not need authentication tokens from players in order to submit runs on their behalf.
- You can use any normal user authentication token, including your own.
- The user who submits the runs (including via the API) will be noted as the "submitter" of those runs, and have their name displayed as such on the run pages.
- Players in runs are specified within the JSON "players" field, and they can be specified in two forms: as users (for which you'll specify a SRC user id) or as guests (specify a name). I'd recommend finding existing SRC accounts for users in question rather than submitting by name wherever possible. With that said, game moderators have the ability to edit the runs and update these later.
You can find more details about run submission via the API in the POST /v1/runs documentation.
@Camcorder, thanks so much for the response! I was reading the API documentation and it appeared to disallow this:
"When players
is not set, the run is assumed to be performed by the user submitting the request. Regular users (i.e. non-game mods and non-global mods) cannot set this element. Otherwise, you can specify a list of users and/or "guests" that participated in the run."
https://github.com/speedruncomorg/api/blob/master/version1/runs.md
Was I simply misreading the documentation?
**EDIT
I would like to clarify that I don't want to muck up the migration and mess up the leaderboards as they stand, that's why I'm being so thorough.
@Camcorder Ah, that's very unfortunate. Is there any way I can get a temporary moderator API token for the lone purpose of migrating the runs? Maybe a dumbed down token that only allows the submission of runs where the player is not a runner, with no auto-verification?
Or alternatively, I could link the finalised git repo to a site-moderator familiar with the api and allow them to run it with their token, so they can make sure that there's no foul play intended? I doubt the script will exceed more than 300-400 lines, and it's using the python implementation.
I appreciate the response!
You just need one of the mods for that game, not a site mod.
Also, if you have 'verified' set to false in your post requests you won't mess anything up on the existing leaderboards. It'll be annoying to clean up if something goes wrong so you definitely still want to get the full migration right the first time, but if you need to do a test with one run or something you can do that.
@ShikenNuggets is correct on all counts! You might ask the game moderators to add you as a moderator to perform the migration.
One of the mods is willing to do it for me, but he has never programmed before a day in his life. I'm uncomfortable with letting him run the script. Should I ask to borrow his auth key, or is that a big no-no? And yes I won't be setting verified (the concept of mass submission is already scary enough).
I did ask one of the game specific mods if I could be given moderator temporary, but he said it was out of the question. I believe he has a superior, so I'll ask him to see what be thinks.
Thanks for the feedback!
Thanks. I'll see where it goes. Just one more thing. I imagine if the mods do consider allowing me an auth key/mod they'll he worried that I might have some bad intent (as I'm sure unrestricted access to an api key is a dangerous thing for a board). In order to reassure them does SRC support rollbacks for games/boards/categories? I imagine it would make them feel a lot better to know if they could revert any damage that could be caused by either a misshap or someone with bad intent.
Thanks again!
In order to reassure them does SRC support rollbacks for games/boards/categories?
We don't currently expose any rollback functionality to game moderators. We actually just discussed this internally this morning, and it's on our roadmap for 2024, but can't I offer a solution for this today - sorry!
@Camcorder Thanks for your help!
I'll work with the game-moderators from here.
@Camcorder not directly related to this topic, but to the roadmap you mentioned. Are there plans to release some sort of public roadmap for changes in the future? Since the last major site update, the small feature updates have been releasing on a rolling basis and it would be nice to see what is being changed.
@VyPr thanks for asking!
I don't think we'll be able to share a public roadmap in the near future.
We maintain a big backlog of new features, bug fixes, and other improvements, but the actual development work gets scheduled very dynamically. For instance, right now we're working on a major new feature launch due in October, but are also fixing bugs every day. The major new feature isn't ready to be announced, and it's not unusual for a bug to be identified, scheduled, and fixed in the same day. We're a small team and prefer to operate with as little overhead (read: as much flexibility) as possible, and maintaining a public roadmap would both set unrealistic expectations and slow down development.
With all of that said, we do plan to be more consistent in providing site updates (via site news) where appropriate.