Skip to content
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

Update endpoints for fetching Discussions data #123

Closed
nikodamn opened this issue Nov 18, 2020 · 3 comments
Closed

Update endpoints for fetching Discussions data #123

nikodamn opened this issue Nov 18, 2020 · 3 comments
Assignees
Labels
database update Needs a manual database update enhancement New feature or request good first issue Good for newcomers

Comments

@nikodamn
Copy link

nikodamn commented Nov 18, 2020

Hey. Since we are doing some Discussions modernisation some endpoints needs to be updated. Here are latest Discussions API changes which may interest you:

GET <services-domain>/discussion/{siteId}/posts/{postId} ⇒ 
GET <wiki-domain>/wikia.php?controller=DiscussionPost&method=getPost&postId={postId}

GET <services-domain>/discussion/{siteId}/posts ⇒ 
GET <wiki-domain>/wikia.php?controller=DiscussionPost&method=getPosts

GET <services-domain>/discussion/{siteId}/threads/{threadId} ⇒ 
GET <wiki-domain>/wikia.php?controller=DiscussionThread&method=getThread&threadId={threadId}

GET <services-domain>/discussion/{siteId}/threads ⇒ 
GET <wiki-domain>/wikia.php?controller=DiscussionThread&method=getThreads

Due to that fact discussions.js and overview.js scripts might require some update. Additionaly we've noticed that you are using /discussion/{siteId}/posts/{title} https://github.com/Markus-Rost/discord-wiki-bot/blob/master/functions/discussion.js#L83 and /discussions/{siteId}/threads/{title} https://github.com/Markus-Rost/discord-wiki-bot/blob/master/functions/discussion.js#L200 which aren't really supported endpoints. It would be better to use one of those posted above.

Additionaly it would be great if you could add some User-Agent request header, but that's just nice to have. Thanks and feel free to ping me if you have any questions.

@Markus-Rost Markus-Rost added database update Needs a manual database update enhancement New feature or request good first issue Good for newcomers labels Nov 18, 2020
@Markus-Rost Markus-Rost self-assigned this Nov 18, 2020
@Markus-Rost
Copy link
Owner

Thanks for the heads up, I'll update my usages.

Additionaly we've noticed that you are using /discussion/{siteId}/posts/{title} and /discussions/{siteId}/threads/{title} which aren't really supported endpoints.

Those are just /discussion/{siteId}/posts/{postId} and /discussion/{siteId}/threads/{threadId} usages in case the user provided search term (title variable) is a post or thread id. I'll update them to the new endpoints as well.

Additionaly it would be great if you could add some User-Agent request header, but that's just nice to have. Thanks and feel free to ping me if you have any questions.

I'm currently using Wiki-Bot/{version} (Discord; discord-wiki-bot) as my user agent for all requests.

@nikodamn I currently have issues open to add UCP message walls (#68) and UCP article comments (#69) to the bot, what would be the correct endpoints to get those?

@Markus-Rost Markus-Rost changed the title Update endpoints for fetchind Discussions data Update endpoints for fetching Discussions data Nov 18, 2020
@rybmat
Copy link

rybmat commented Nov 18, 2020

@Markus-Rost the endpoints linked in the issues for wall/comments are ok. We'll probably change the wall one to /wikia.php, but this will not happen very soon (probably next year)

@Markus-Rost
Copy link
Owner

Ok, thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database update Needs a manual database update enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants