Pathoschild / Wikimedia-contrib

A collection of user scripts and Tool Labs tools intended for users of Wikimedia Foundation wikis.
MIT License
44 stars 28 forks source link

Add JSON APIs #40

Open PiRSquared17 opened 9 years ago

PiRSquared17 commented 9 years ago

It would be great if there were some way to query account eligibility in a machine-readable format. The output could be something like JSON, XML, or YAML. JSON would be my preference.

[This is a feature request/enhancement, not a bug.]

PiRSquared17 commented 9 years ago

HTML is machine readable too, but scraping is a pain compared to using JSON results.

Pathoschild commented 9 years ago

A JSON API is something I do want to add in the near term; I'm looking to transition the tools to node.js, which seems much better suited than PHP to building an API. I did a very early prototype yesterday; if all goes well I'll have an OAuth login (#30) on node.js, and I'll port the framework and move the tools over one by one (building an API for each as part of the migration).

legoktm commented 1 year ago

I too would like an API for AccountEligibility.

legoktm commented 6 months ago

For reference, here's the code I have that's scraping AccountEligibility: https://gitlab.wikimedia.org/toolforge-repos/poty-stuff/-/blob/main/src/eligibility.rs?ref_type=heads#L9 - it's primarily looking for the data-is-eligible="1" string.