-
Notifications
You must be signed in to change notification settings - Fork 19
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Implement random page API #4
Comments
Are you still looking for help on this issue? If so, I'd like to pitch in. I'm not sure what is meant by, "Implementation for this should follow the summary or related method flow". But I'm fine writing tests and using types. |
Sure, @friendofdog , help with this would be welcome. You only need to use types and write unit tests, you can ignore the other part |
Returns data from random Wikipedia page in format based on given argument. resolving dopecodez#4
resolving dopecodez#4
Understood, @dopecodez . I wrote tests and a basic implementation. (Pardon me for doing so, I borrowed much from existing tests. First time using Jest.) As for types, the Wikipedia.org API returns six unique types: 5 kinds of JSON objects or an HTML string. Should I add the missing types to |
I think it's best to borrow from existing tests. That's an interesting question, I think we can skip over the types not currently present in the package. We would ideally need to implement the method like I will take a detailed look at your changes once you open an MR, @friendofdog , thanks. |
Added summary, HTML, title resolving dopecodez#4
Added related, mobile-sections. mobile-sections-lead is another return format, but is almost identical to mobile-sections (it has one extra field, "geo"). Similar enough that no additional type written for mobile-sections-lead. resolving dopecodez#4
Returns data from random Wikipedia page in format based on given argument. resolving dopecodez#4
resolving dopecodez#4
Added summary, HTML, title resolving dopecodez#4
Added related, mobile-sections. mobile-sections-lead is another return format, but is almost identical to mobile-sections (it has one extra field, "geo"). Similar enough that no additional type written for mobile-sections-lead. resolving dopecodez#4
Pardon the delay. I took a look at the return formats from the API and they all looked fairly essential. So I just went ahead and creates types for all of them. Just made a draft PR, #11. How does it look? |
Looks good, @friendofdog . Lets continue this conversation there. |
relatedItem too redundant with wikiSummary. Added fields to wikiSummary resolving dopecodez#4
Returns data from random Wikipedia page in format based on given argument. resolving dopecodez#4
resolving dopecodez#4
Added summary, HTML, title resolving dopecodez#4
Added related, mobile-sections. mobile-sections-lead is another return format, but is almost identical to mobile-sections (it has one extra field, "geo"). Similar enough that no additional type written for mobile-sections-lead. resolving dopecodez#4
relatedItem too redundant with wikiSummary. Added fields to wikiSummary resolving dopecodez#4
There are a lot of new REST APIs for wikipedia present in the REST API docs.
We'll look through them one by one and implement the same. Any one who wants to pick up on any other REST API should ideally open a new issue.
The REST API has a /page/random/{format} endpoint which which gives a page in given format. This is something I would love to have in wikipedia. Find more details here.
Implementation for this should follow the summary or related method flow. Remember to write unit tests for all possible scenarios in your new functions, and try to use types as far as possible.
I'll be happy to help anyone who wants to pick this up.
The text was updated successfully, but these errors were encountered: